objective-c

Get Place Location

I need put information about place, where is iPhone now, to UILable in my screen. [Country][City][Street] and maybe coordinates [lat][lng]. For example in my UILable should be: Your location is German, Berlin, Tiergarten Can someone show me really simple code how can i get such information that put in my UILable? ...

Tracking touches in UITableView

I am trying to intercept the touches moved in a UITableView. My goal is to not pass through touches moving up or down on the far right hand side of the table view but to handle them for other purposes. I can track touches moving on the x plane but not on the y plane. I have subclassed both the tableview and the tableviewcells, but no suc...

Declaring and releasing objects efficiently, object level or local to a method?

Is there a reason, other than as may be required by object scope across different methods of the object, to use an object like this: @interface ... ViewMgmtAppDelegate : NSObject <UIApplicationDelegate> { Obj *obj1; ... } @end @implementation - (void)applicationDidFinishLaunching:(UIApplication *)application { obj1 = [Obj alloc]; [wind...

Properties and Instance Variables in Objective-C

I'm rather confused about properties and instance variables in Objective-C. I'm about half-way through Aaron Hillegass's "Cocoa Programming for Mac OS X" and everything is logical. You would declare a class something like this: @class Something; @interface MyClass : NSObject { NSString *name; NSArray *items; Something *so...

NSCollectionViewItem double-click action?

How do I set an action for when a user double clicks an NSCollectionViewItem. NSTableView, for example, has the setDoubleAction method. Is there something similar for NSCollectionView? Thanks ...

How to add a new Menu at the end of MenuBar?

One question is : Now I want to add a new Menu at the end of MenuBar, not to add a menuitem at the known menu. just like the Xcode Items: The last menu is Help , I want to add a new Mneu(MyMenu) behind the Help Menu ? How to do ? Thanks very much! ...

Can I include a custom XML file in my application for default content?

I want to load content into my application from a web server, but if the internet is not available, I would like the user to have access to either default or old, downloaded content. It will be XML formatted. I know how to download XML from the web server into my app and I can store the XML-as-string and reload. But, how do I "ship" t...

How to apply checkmarks to all cells in table on click of button on toolbar?

I have table of 15 rows, when i click a button on toolbar i need to apply the checkmarks on all the 15cells at a time. Can somebody help i need it urgently..... ...

save and restore state of a tab bar controller

I have an application that has a UITabBarController with two tabs, each having its own navigation controller. Now I want to store the state of the application when the user closes it, so that when the user relauches the application will show the same place as the last time before it was closed. So, in applicationWillTerminate: I have [N...

iPhone SDK: loading UITableView from SQLite

Hi, I think I got a good handle on UITableViews and on getting/inserting data from/to SQLite db. I am straggling with an architectural question. My application saves 3 values int the database, there can be many/many rows. However would I load them in the table? From all the tutorials I have seen, at one point entire database is loaded ...

How to append querystring in url using objective c ?

Hi, NSString *post = @"&username=adam&password=test"; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithStr...

Iphone and right-to-left text

How can I display RTL text(e.g. arabic) in UITextView? ...

Implement add contact as in iPhone SMS app

I want to build the 'add user' functionality as it is available in the the messages app, where when the user starts typing a username the app searches for the appropiate user and shows it in a circle as in the screenshot below. It this a build in functionality? If so, what is it called? I would also like to know how to implement the ba...

Clear all the data in a particular Pesistencestore.

I use two PersistenceStores one for saving phone setting related entities and Other for saving User details related entities. I need to clear all the User details related entity on log off , so i delete the userdetails.sqlite using [NSFileManager removeItemAtPath: error:] method. After this i setup the managedobjectcontext but i am not...

How can I open UIViewController with NavigationController from UITableViewController with UITabBarController

I have 2 UITableViewController on UITabBarController without navigation bar. That's how i created it: UITabBarController *tabBarController = [ [UITabBarController alloc] init ]; tabBarController.viewControllers = [ NSArray arrayWithObjects: [ [ [MyUITableViewController alloc] init ] autorelease ], [ [ [MyUITableViewController alloc...

Where can I find custom UITabBarSystemItem icons?

Is there a resource out there some place that has custom UITabBarSystemItem icons that others can use. I know you get some from Apple to start, but I would imagine there are a lot more that are very common. I don't see a reason for each person to recreate the wheel for things like home, settings, etc... ...

how to handle push notification if application is already running?

how do we handle push notification if app is already running? means i want to show an alert if app is running instead of push notification alert.if app is not running then show push notification alert.also tell me that if i send a payload to APNs how do i cancel the payload? ...

Help needed using Apple Keychain.

I am using trying to utilize some code found here to store and retrieve username and password. However, when I add the class (SFHFKeychainUtils) I get the following errors: "_kSecAttrAccount", referenced from: _kSecAttrAccount$non_lazy_ptr in SFHFKeychainUtils.o "_SecItemDelete", referenced from: +[SFHFKeychainUtils dele...

Drawing a rounded drop shadow with Quartz

I am trying to draw a drop shadow underneath an image to which I apply rounded corners, but I have 2 problems: The drop shadow only appears underneath the non-rounded area of the rounded image and not underneath the bottom rounded corners as one would get if applying a drop shadow in photoshop. Using the same settings as in photoshop (...

Linking to PostgreSQL and SSL

Hi, I'm trying to use libpq, the client library for PostgreSQL in a Cocoa app. First thing, adding the header files: I tried adding the path to the PostgreSQL header files under User Header Search Path on my project's properties and then compile but for some reason XCode can't see them. The solution was to manually add the files and a ...