objective-c

What is the difference between the NSImage and UIImage?

Hi, what is the basic differences in using NSImage and UIImage for iPhone? ...

how to insert value from one table to other table in sqlite3 database.

hi I am new in iphone i am developing a application with data base i am create a database and have to table we want to insert one table value to other. I am not understand how do this. if any body know help me with coding. ...

How to get the data back from the UITextField?

Hi, I have a textfield to type the username, how will i get back the data to perform some action from the UITextField? ...

Has anyone had experience using the Objective-C bindings for YAJL?

http://github.com/gabriel/yajl-objc I've already tried SBJSON, and while it works, I'm looking into alternative options to improve on parsing speed and memory consumption. Usage of this library doesn't seem to be as straightforward as SBJSON though, and I'm not sure how to begin using yajl. Something like this: NSArray *parsed = [dat...

Push ViewController from Right To Left with UINavigationController

Hi, As everyone know the UINavigationController push a ViewController from Left To Right, is there a way to push the View from Right To Left? like the animation for the back button. For now I have this: [self.navigationController pushViewController:viewController animated:YES]; ...

Exception thrown with SQLite result from Column with NULL value

Hi, when selecting a column that can contains a NULL value I get an exception thrown on this statement. self.DirectionFromCity = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 8)]; How should I go about setting these attributes as NULL values are OK for the Database. ...

Creating csv files in ObjC

Hi All, Is it possible or any library available for creating .csv file in ObjC ? Thanks ...

Bidirectional Map in Cocoa

Cocoa provides NSDictionary, which essentially is an associative array. Is there a nice way to get bidirectional associativity? i.e. one way would have been if NSDictionary had a keyForObject: method which mirrored the behavior of objectForKey:. I don't really care if NSDictionary is not the way to get this. I know NSDictionary does pr...

Escaping characters in Objective C on iPhone

I'm trying to pass the following string: NSString* jsString = [NSString stringWithFormat:@"myFunc(\"%@\");", myParameter]; from Objective C to JavaScript using the stringByEvaluatingJavaScriptFromString, where myParameter is a string value. How can I ensure that the myParameter string doesn't contain any JS-unsafe characters without b...

asterisk in variable declaration in headers in obj-c

I get that asterix is for pointers, and I understand about pointers now. But I'm still not sure why when declaring a variable in a header I need to use an asterix, for example: UINavigationController * navController; why isn't that: UINavigationController navController; Thanks ...

How to develop addons (hacks) for IPhone?

Greetings everyone.. I wanna develop an addon (basically a hack) for IPhone native phone app. My entire idea is to provide a "delete" button on navigation bar of the phone app. When user clicks on that delete button I wanna allow to delete the call records from the mobile app itself (where APPLE does not allow this). This kind of hack (...

Internationalization of iPhone Applications

Are there any settings in cocoa touch so that we can select different languages in an application? i.e, in our application if we select swedish, then the swedish language must be selected and the input data must be displayed in swedish.. thank you .. ...

NSInvalidArgumentException: Illegal attempt to establish a relationship between objects in different contexts

I have an app based on the CoreDataBooks example that uses an addingManagedObjectContext to add an Ingredient to a Cocktail in order to undo the entire add. The CocktailsDetailViewController in turn calls a BrandPickerViewController to (optionally) set a brand name for a given ingredient. Cocktail, Ingredient and Brand are all NSManagedO...

Convert std::basic_string to NSString in Objective-C / Cocoa

How do I convert a std::basic_string to a NSString ? ...

retain object in objective-c

I'm doing a set method: OBS: somobject is an attribute of a class. – (void)setSomeObject:(SomeObject *)newSomeobject { [someobject autorelease]; someobject = [newSomeobject retain]; return; } on [somobject autorelease] I declare that I don't want more to own the object under the scope of setSomeObject. Does the "som...

Getting Safari document title/location with Scripting Bridge does not work in full-screen mode

I'm trying to get the URL and document title from the topmost Safari document/tab. I have an AppleScript and an objective-c version using Apple's Scripting Bridge framework. Both versions work fine for most web pages, however when I open a Youtube video in full-screen mode, the Scripting Bridge based version fails. The Apple Script work...

How to enable user to click the View to hide the kb on iPhone?

I find that the View do not have a touch inside or similar event. So, I make a button on top on the view, and set it Alpha to 0, but after I set to Alpha 0, it cannot touch anymore. Any ideas on this? ...

MKMapView userlocation difference

Hello guys! Declaration;) MKMapView mapView; I can't found the difference between mapView.userLocation.location.coordinate and mapView.userLocation.coordinate. Is there any? ...

Core data query on a NSSet of NSSet

Hi everyone, I'm struggling with core data... I don't understand some things so if someone could help me, I would be very grateful! I have an entity (Recipe) with a relationship to-many with another one (Meal). I would like to select all the recipes which have no connection with a meal... so I've tried: Code: [myRecipes filteredSetUsin...

Objective C - preferred way to create and initialize an object

Is one of these two ways to create and initialize an object preferable? MyClass oClass = [[MyClass alloc] init]; oClass.length = 5; oClass.text = @"Hello"; or using a class method that contains about the same code but looks like this: MyClass oClass = [MyClass initWithLength:(int) 5 andText:(NSString *) @"Hello"]; I hate it when I ...