objective-c

iPhone Simplest Communication between Threads

I have an iPhone app with a secondary thread to handle XML parsing. Inside some of those methods, I need to reference dictionaries (for look up, not modification) created and populated in the main thread. Apple's documentation indicated to me that global variables might be the best way to accomplish this. I'm just now sure what the impl...

What challenges are there in making an iPhone IDE for Windows/Linux?

First of all, is this possible? If so: What challenges would I encounter in making an XCode imitation for iPhone/iPod development for Windows or Linux? I was thinking about using gcc as the actual compiler for the objective-c and (VB).NET for the IDE. Will that work? It doesn't need to compile to iPhone OS until it is to be tested o...

Is there an open source depository of custom classes for the Iphone?

I'm trying to learn Objective-C for xcode. I was wondering if there was an open source depository for custom classes. Things that programmers re-use. ( ie. playing card class, or peer to peer methods ) I've searched google, but so far haven't seen any type of site. ...

Strings in Objective-C++

I just switched my code from Objective-C to Objective-C++. Everything goes swimmingly except for two lines. NSString * text1=[[NSString stringWithFormat:@"%.2f",ymax] UTF8String]; This line complains that error: cannot convert 'const char*' to 'NSString*' in initialization The second error related to the first is from the line: CG...

iPhone: How to store a location (CLLocationCoordinate2D) inside a class w/o leaking memory?

I am creating a library which contains an API for setting the current location based off some value collected by the GPS. I want to store this location in my class and later, change the behavior of my library if it is set. What I had in mind was: @interface myLib { @property (nonatomic, retain) CLLocationCoordinate2D *location; } @...

Why Obj-C Strings are always *NSString not NSString

Is it normal, that declaring NSString c="a sample string"; cannot work, and must declare it as NSString* ? It's different from C++ strings, am I right? Can it be generalized to other Obj-C objects? ...

Show NSSegmentedControl menu when segment clicked, despite having set action

My question is based on another question. Instead of repeating a bunch of stuff, I hope it's okay that I refer you to that other question instead: http://stackoverflow.com/questions/1203698/show-nssegmentedcontrol-menu-when-segment-clicked-despite-having-set-action/ My question is: How would the code within [self showGearMenu] look lik...

objective c id *

I am using the KVO validations in my cocoa app. I have a method - (BOOL)validateName:(id *)ioValue error:(NSError **)outError My controls can now have their bindings validate. How do I invoke that method with a id * NOT id To use the value that is passed in (a pointer to a string pointer) I call this: NSString * newName = (NSString ...

UIEvent has timestamp. How can I generate an equivalent value on my own?

According to the cocoa documentation, timestamp on UIEvent is "the number of seconds since system startup." It's an NSTimeInterval. I'd like to generate, as efficiently as possible, an equivalent number. Of course, I want to do this where UIEvent don't shine. :-) ...

UIPickerView with NSDictionary

I am a .NET programmer and new to Objective C. I am trying to make a UIPickerView which acts like a .NET dropdownlist. User sees the list of text and selects one and the selected value (which is the ID) is used in code. I have been browsing for almost half a day trying to figure this out. I could add a regular PickerView with list of...

Override System Preference Pane?

Is there a way to override / disable a system preference pane? I'm wanting to put an application together that would disable or override the Energy Saver preference pane, and would put it's own rules in place for putting a machine into standby, turning off the monitor, or other various energy saving activities. ...

Help with a compiler warning: Initialization from distinct Objective-C type when types match

Here is the function where I get the compiler warning, I can't seem to figure out what is causing it. Any help is appreciated. -(void)displaySelector{ //warning on the following line: InstanceSelectorViewController *controller = [[InstanceSelectorViewController alloc] initWithCreator:self]; [self.navController pushViewContr...

how to solve ran time error NSString, sqlite3_column_text NULL problem?

I am new in iphone application developer i am using sqlite3 database and in app delegate i am wright following code and run properly we also find value from database to in my aplication, but immediately the application is going to crass why this is occurs i am not understand. code is given bellow -(void)Data { datab...

How to get attributes from an element in XML

I have constructed an XML tree structure of an XML file. I am able to trace the entire tree. When i want to retrieve the attributes of an element, it is returning as NSXMlNode of kind NSXMLAttributeKind. How can i extract the key value pairs in the attribute node. ...

Add safari bookmark from iPhone app

I'd like to have my applicAtion be able to add bookmarks to safari progammaticly, is this possible. ...

Create a table using Objective C for Mac and display values in the table.

Can anyone guide me as to how to create a table using Objective C for Mac OS X. The program should read values from an NSArray object and display the values in the table. I would appreciate it if anyone helped me out. ...

Iphone - How to load Chinese text

Hi, I have a file with Chinese text that I want to use in my xcode project (I'm planning to load it through a database as it is lot of text), the problem is I dont know how to add the font to my project so that its viewable when used on an iPhone? Thanks :) ...

Authenticating Iphone Login with PHP/MySQL and HTTP Responses.

Hi there, Im trying to create a iPhone Objective C login page using PHP/MySQL to authenticate. Im trying to use HTTP responses as a way of authenticating. Right now it always fails to login , regardless of what you enter. `- (IBAction) login: (id) sender { // this part isnt really implemented yet! NSString *post =[NSString stringWith...

What is asynchronous image downloading and how can I download too many images ?

I have too many images to be download from net into iPhone? How can I build an application using asynchronous image downloading?. ...

How to change a sound playing start time in objective-c?

I would like to play a sound in Objective-C with a millisecond start time. I know it is possible this way but "currentTime" only takes seconds: currentPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil]; currentPlayer.currentTime = 100; Is there a way to set the start time with milliseconds? ...