objective-c

Generate skeleton method bodies in implementation files in Xcode

In Xcode, for Obj-C programs, is there a way to generate skeleton method body in the .m file if I add a new method or implement an interface in the corresponding .h file? Like in Eclipse, if you implement an interface, it will bring in the method skeleton according to the definition of the interface. ...

Crashing core data application.

Hi, I have setup my first core data project. Everything works fine until I do the following (in Simulator/Device): • Close App using "Home Button" • Double press "Home Button" and quit the app from background. • Reopen the app As soon as it reopens there is an instant crash with nothing in the log. The last thing logged is "Program ...

delegate problem

A, B,C is class. A define delegate. B define delegate. C implements delegate. how do C implements delegate of A by B ? it means that C want implements A's delegate, but B include A. so it's wrong! I want to implements A's delegate by B? what to do in B. Transfer A'delegate to C ?? please help me! thanks! ...

How do I save information retrieved from an Addressbook to NSUserDefaults?

Hi, I am trying to use a PeoplePicker to retrieve the name and address of a contact and store it into the NSUserDefaults, which i eventually want to retrieve it on a tableview. My question is how do I save the information in NSUserDefaults. I have used NSDictionary, but I am not making any progress. so I'm trying to save the array to th...

class-dump gives error "Error: Cannot find offset for address in dataOffset for address"??

hi All, I am trying to dump the springboard headers from my mac using following command class-dump /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard -H -o /Desktop/SpringBoard but I am getting the following error : 2010-09-13 16:14:23.325 class-dump[1955:10b]...

how to extract 64 bit signed integer value

I'm querying a NSDictionary for a value. Because I got problems I printed the object. It shows me the following: <CFString 0x5d33630 [0x26af380]>{contents = "myDictionaryItem"} = <CFNumber 0x5d58940 [0x26af380]>{value = +1286301600, type = kCFNumberSInt64Type} So it is of type signed 64 bit integer. So I tried to extract the value like...

distribute library for iphone development

hey! I have created a project in xcode which creates a ".a" file. fine, this works! but now I want to give this .a file to another company, who have to develop with this classes. when I'm create a new project and add the .a file in the new project, no files could be found. for example: when I link to the "XRActionView.h" file or so (whi...

Multiple MPMoviePlayerControllers on iOS 3.2/4.0

Hi guys, The question is can I have two instances of MPMoviePlayerController simultaneously in one UIViewController? I'm trying to create a smooth transition between two movies in iPad app, but when I create the second MPMoviePlayerController the playback of first one is stopped and can't be resumed. I didn't found any restriction for h...

How can I get current time in a +7 timezone on iPhone?

I want to get the +7 timezone on iPhone, how can I do so? Thank you. ...

check if NSNumber is empty

How do I check if a NSNumber object is nil or empty? OK nil is easy: NSNumber *myNumber; if (myNumber == nil) doSomething But if the object has been created, but there is no value in it because an assignment failed, how can I check this? Use something like this? if ([myNumber intValue]==0) doSomething Is there a general met...

How to get the duration of captured video and set an image to the Thumbnail of captured Image in Iphone sdk?

Hi guy's I need to get the duration of the video capture and to set the image for the thumbnail of captured video. Please guy's can anyone help how to get rid of this? - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSLog(@"Success! Received %d bytes of file data", [currentFileDataContainer length]); // urlStr = [[...

Adding and Removing Views - Best Practice

Hi, I have developed a few applications now all using single view controllers. In each application in the application delegate I alloc/init the first view controller in "didFinishLaunchingWithOptions" and [window addSubview: view_controller.view]. Now my question is what is best practice for removing and adding secondary views. At the...

Replace a line in a file

Hi, I have a very large text file, and my iPad program needs to occasionally replace a single line of data (newline: '\n'). How can I do this efficiently? Writing the entire file at once is not an option. I've been looking into NSFileHandle, and it looks like it will do what I want; right now I'm having trouble figuring out how to find...

Expected token not found in attributes: ITunesSoftwareApplicationTestedOn40

When trying to submit my Application using Application Loader i am getting the following error: Expected token not found in attributes: ITunesSoftwareApplicationTestedOn40 Where can i set this attribute? Thanks ...

Changing the sortDescriptor of a FetchedResultsController dynamically. Ideas?

I'm having difficulty understanding how to update my fetchedresultscontroller with a new sort. I initialize a frc the standard way in my class. But how exactly do you modify the fetchrequest with a new sortdecription? My app has a sort selector in the appSettings that the user can change on the fly. Is there a way to update the frc dyn...

double problem in xcode or me doing something wrong

Hi I would guess it's the simplest thing but it's really confusing me. I'm sure I've successfully used doubles before but now I'm having trouble. I just made a new 'test' project to see if I can get it working, but all I'm trying to do is set a double value. So in the View Controller's viewDidLoad i've typed: double z = 2938.09; NSL...

Core Text availability

Hello. What platforms is Core Text available on from my understanding it is: iPad 3.2 & iPhone 4.0+ Is this correct and it is not available in 3.2+ for iPhone? Thanks James ...

How to detect keyboard events on hardware keyboard on iPhone (iOS)

I have an app with a login page that has three fields for three different random characters. When the user leaves the last field, the soft keyboard disappears and the user can touch a "login" button on screen. When there is a hardware keyboard (bluetooth or physical) attached, I'd like to be able to hit "enter" on it. However because th...

Core Data : Keypath name not found in entity

Hello, I'm crashing with this message : 'NSInvalidArgumentException', reason: 'keypath name not found in entity Obvisouly I'm not querying my entity correctly . //fetching Data NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSManagedObjectContext *context = [(AppDelegate *)[[UIApplication sharedApplication] delegate...

How does multithreading work in Objective-C on the iPhone?

I'm confused about the concept of "threads" in iPhone development: Why are threads necessary / useful? How can threads be used in Objective-C? ...