objective-c

NSView inside self window

I have basic *.xib file, which have NSView. How can I use another nib files for this Custom View? What is NSViewController and how should I use it? ...

Using NSPredicate with Core Data for deep relationships

I have an NSArrayController, companiesController bound to a top level Core Data entity, Companies. A Company has many Department's, and a Department has many Employee; these are represented by the 1-to-many relationships, departments and employees. Based on the attribute salary of an Employee I thought I could dynamica...

Two related questions about iPhone autorotation

1) Is it possible to change the speed of autorotation on the iPhone? 2) Is it possible to time an animation to take place during the autorotation animation? I would like to resize a photo while rotation is occuring, rather than when it's done. ...

iPhone Contacts App Examples

I'm looking for references on how to reproduce the iPhone Contacts App. Ideally it would be in one resource: book, video, tutorial, etc. But I realize that me be too much to ask for. ...

Can I add two right-hand buttons to a UINavigationBar?

I would like to be able to have a UINavigationBar with a left-hand UIBarButtonItem, two right-hand UIBarButtonItems, and a title. I have resorted to using a UIToolBar to simulate this, but the toolbar looks slightly different than the UINavigationBar, and it also won't bevel UIBarButtonSystemItems. Is there a way to make a UINavigation...

Is this wrong or am i missing something ( int count = 10, x; )

Came across this example in the book im reading and it didn't make sense at all to me, I'm probably missing something but it seems like youre assigning count with the values '10' and then the value 'x' which isnt even an int. Just wondering if this is a syntax that is valid. The book says this: The variables count and x are declared to...

Objective-C Runtime

The Objective-C Runtime Reference says: “Deprecated” below means “deprecated in Mac OS X version 10.5 for 32-bit code, and disallowed for 64-bit code.” and I would like to use class_setSuperclass in Max OS X version 10.5 even though I still can do it the compiler gives warning telling me its deprecated but it still builds and the ...

Creating a fanning out core animation

I'd like to create an animation that starts with the appearance of a small circle then progresses like this: 2nd larger circle appears 3rd larger circle appears 1st smallest circle disappears 4 larger circle appears 2nd circle disappears and on to probably six or so circles. Circles will fades in/out. Each larger circle encloses th...

Issue with view controllers - Prior controller (images/content) is still present (Its not *gone*/dealloc'd/released)

So, I started typically by init the controller from the nib and popping it onto the view stack. But the problem is that the first controller isn't really gone - its still around. So, we started down the path of this: Starting w/the appDelegate and loading the RootViewController: mRootController = [[RootViewController alloc] initWith...

Objective-C Soap Proxy Generator similar to whats in .NET

Hi, We have a contractor doing an Iphone native app in objective-c. They need to call some of our web services to get data. Is there some kind of proxy generator for obj-c that will create native objects that call web services? C#/.NET has this built in--you just add a service reference in visual studio or you use a command line tool...

OCUnit (SenTestingKit) error file is not of required architecture

I'm trying to build a project that uses OCUnit to run tests but get the following errors when linking: ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//SenTestingKit.framework/SenTestingKit, file is not of required architecture Undefined symbols: "_STComposeString", referenced from: -[ReaderTest testEmptyFile] ...

What Cocoa class is this?

Hi, Can somebody please tell me which class/IB widget this is for the headers where it says "Task", "Grade", "Files"? Thanks. EDIT: My question was totally unclear. Let me rephrase. This is a screenshot from an app called "Schoolhouse". I was wondering how I can get that same style for the headers (headers being where it says "Task...

Code to generate random strings creates same succession of identical strings

I have the following method that should create a 20 character ID (sometimes with a prefix) and return the ID. It seems to reset on launch and every time I use it it will create the same succession of identical numbers. +(NSString *)createUniqueIdentifier:(NSString *)withPrefix { NSString *outstring = nil; if (withPrefix!=nil &...

Finding Inverse Exponential of Number Using C or Objective C

How would a programmer like myself learn how to find an inverse exponential of a number? on my calculator 2nd LN or e^x. It is similar in concept to the neperien function on calculator e.g. the log of 2 is about 0.3 and the inverse log or 10^x of 0.3 is 2.) Note: This is to be used within an iPhone project using iPhone SDK Note: Her...

Memory management in Objective-C and setting pointers to nil

Will the pointer to an object go to nil when its count goes to 0 or when dealloc is called? Why or why not? ...

Simple NSImage drawing not working as expected

This doesn't do anything: NSImage* testImage = [[NSImage alloc] initWithSize:NSMakeSize(2.0,2.0)]; [testImage lockFocus]; [[NSImage imageNamed:@"testImage"] drawAtPoint:NSMakePoint(1.0,1.0) fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; [testImage unlockFocus]; [levelView setImage:testImage]; ...but this does: [levelV...

I need a good analogy to make sense of Class methods vs. instance methods

Im getting fairly confused as the book im reading is delving into the NSNumber class and talks about all the different methods you can call on it. I have a couple questions: 1.) Do you not have to call a typical alloc or init on foundation classes? 2.)in what cases would you use, say, numberWithChar: as opposed to initWithChar (i thin...

problem in getting the Distinct values from the database uisng sqlite distinct query in my xcode

I had a problem to retrieve the Distinct values from my database and the code I written for that is: In viewWillAppear of my controller I written as..... -(void)viewWillAppear:(BOOL)animated { CorkItAppDelegate* appDelegate = (CorkItAppDelegate*)[[UIApplication sharedApplication] delegate]; winesList = [appDelegate getWineDetail...

How to use Reachability class to detect network status?

i am creating an application which requires internet must be avialable to use it.I want to use reachability class in my project and i want to detect if user has no internet connection whatever the technique is either wifi,Carrier or whatever the way is.I want a step by step guide for this.Thanks ...

Sorting in NSMutableArrary in iPhone

Hello, I am parsing an XML and storing all data in NSMutableArray in form of Dictionary. NSMutableArray * stories; // a temporary item; added to the "stories" array one at a time, // and cleared for the next one NSMutableDictionary * item; - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:...