Create Category Getting Error "cannot define category for Undefined class" - objective-c

I am facing a problem when i try to create 2 category of my OWN Simple Class ( Class name is Car). I created 2 Category for this class just for testing " Car+show.h" & "Car+Protected.h". I Just write very small methods in to all like NSLog something sting. My Problem is that when i build application I am getting error into Category File " Can not define Category for Undefined Class Car". Please Suggest me where i am Wrong.

If you import the category header files into Car.h, and your category header files themselves import Car.h, then you have a circular import which is causing you your problems.
Categories are for adding functionality to a class or splitting an interface out across several headers. If you are importing your category headers into your main class header, this is defeating the point.
The category headers should only be included by files that need to use functionality defined in the category.

I have solved my problem luck by chance. I really don't know actual fact about that.
The point is that when i import that category files into Car.h file that time it's create error which i shared with you. But when i Import that same file only and only Car.m file it's work fine.
I really don't know why it's create error when i import that category files into .h file. Please explain why it's getting error?
Thanks Mukesh

Related

Odoo: extends the import function for a specify model

I want to change the Import function of Odoo, for a specify model (in this case, it is mrp_production.
Import Function Image
For example, my csv file has 2 columns only: product_id and product_qty.
I want the Bill of Material to be loaded automatically after importing (currently it is empty). I want to customize the Import function for this model only.
Is there anyone do this before? Or please provide some solutions/links on how to do it.
Thank you very much.
For this, you simply override the create method for the mrp model and try creating one record from form view. If you have written correct logic to get the BOM automatically it will automatically work while importing.
In, import function odoo basically calls the create method for the model.
Thanks

Running an example class

I am new to vb.net and I'm having trouble viewing this class that someone has made.
The link to the class is:
http://www.vbforums.com/attachment.php?attachmentid=86867&d=1323127879
I did the following steps:
1. Create a new project with a form
2. Add the above class
3. Create an object of the class in my form load sub as:
Dim newClass As VisualStudiosTabControl = New VisualStudiosTabControl
But when i try to run it I get a whole bunch of build errors like:
Type 'System.Windows.Forms.Design.ScrollableControlDesigner' is not defined.
and
'Control' is not a member of 'Tab_Control_Example.VisualStudiosTabControl.VisualStudiosTabPage.VisualStudiosTabDesigner'.
Please help me.
Thanks
You are missing many of the parent files and this looks to be designed to be added onto a project. Try to load whiten your solution of your project.

how to import one project(.zexp file) to another project?

can any one tell how to solve
TypeError:('object.__new__(X): X is not a type object (classobj)', <function
_reconstructor at 0xb766fa04>, (<class DateTime.DateTime.DateTime at 0x9382d4c>, <type
'object'>, None))
while importing a one project(for ex. brundelre3.zexp file) to another in zmi.
I tried it importing the project(brundelre3.zexp) already in zmi under / ->import/export (tab)-> import file name ->ownership-> selected the radio button of Retain existing ownership information-> import (button) so it worked properly before but its not working now . Can anyone tell whats the reason for my error.
I can only make wild guesses, you probably need to debug it:
Perhaps you have created a type that has a name that clashes with something built-in.

InvalidDataContractException was handled

I am getting the following error when try to import an xmlschema using datacontract serializer:
Invalid type specified. Type with name 'ArrayOfanyType' not found in schema with namespace 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'.
I know it happened because I am using a List but how would I get around it? by using
knownTypes.Add(typeof(????))
thanks.
You'd need to share the XSD bit here. My guess is that one of the elements in the schema is of type xs:any. Assuming you meant you are using svcutil to import the info, you need to use svcutil /t:xmlserializer to import the schema.

LINQPad 4 doesn't know about HttpUtililty - how to resolve?

I recently started using LINQPad to test bits and pieces and its a great time saver.
However, sometimes it gives me some errors with minor things.
when I want to test this:
HttpUtility.UrlPathEncode("Make sure");
I get this error: The name 'HttpUtility' does not exist in the current context.
Is there a way to get it to recognize basic stuff like HttpUtility?
I just tried writing:
System.Web.HttpUtility.UrlPathEncode("Make sure")
and I am shown this: The type or namespace name 'HttpUtility' does not exist in the namespace 'System.Web'
You need to a reference System.Web.dll. Press F4 (References) and add a reference to that DLL.
Or, if you have an autocompletion license, just type your original query:
HttpUtility.UrlPathEncode("Make sure");
and open the smart-tag that automatically appears. It will present a menu option to add the reference to System.Web.dll and import the System.Web namespace in a one-fell-click!