objective-c

Display an address on a map on the iphone

If I supply an address as a NSString. How can I use mapkit to show me a map with that location centered and a push pin showing that address? What's the easiest way to do this? EDIT: Is there a way to call the built-in Maps app to do that for me? ...

Avoiding infinite recursion synching between multiple NSManagedObjectContexts

The setup: I have two managed contexts setup (on an iPhone application). A main context that I use for most queries and a background context I use for long running operations that I want to happen in the background. I've setup notifications for NSManagedObjectContextDidSaveNotification against each managed object context. In response t...

Iphone - begginer questions - retain data member and Notifications

Hi, Just need 2 really basic clarifications. 1. Lets say I have a class A which has a member delcared like: @property (nonatomic,retain) NSString* stringInstanceVariable ; In one of my methods, I want to initialize stringInstanceVariable to be some string. Do I need to retain it or not ? should I call: stringInstanceVariable = [[NS...

Rotating UIButtons on a view.

I have 5 buttons on a UIView that I would like to plot evenly along a circular path, and have them rotate continuously along that path. To be clear, I don't want to rotate the buttons themselves, I just want them to move along the circular path. What is the best way to manage this? ...

NSTextField binding causes EXC_BAD_ACCESS

I have an NSTextField which is bound to an int in an object that I have included in my nib. When the object changes its int, the text field follows suit, and everything looks fine. However, when I try to change it manually the program crashes as soon as I hit a key. It's not even getting into my setter methods, it just crashes with Pr...

How can I escape slashes and quotes in Objective-C?

I would like to do the following [controller setMessageBody:[NSString stringWithFormat:@"<strong>%@</strong> <br> <br> %@ <br><br> %@ <br><br> Sent From MyApp",self.articleTitle, self.articleDescription, self.articleURL] isHTML:YES]; on the last %@ I would like to do <a href="%@">Hello</a> But I am not sure how to escape it properly...

Problem with linking - iPhone app

I'm having an issue while trying to link an iPhone app to use one of the static libraries that I'm working with. The app works fine with iPhone OS 3.0, but when I try to upgrade to iOS4.0, I'm having a few issues. The library that I'm trying to use is an universal fat which contains versions for arm and i386. Now I'm getting the "symbo...

Is there an interpreter for a stack-oriented programming language available under LGPL / GPL license?

I am looking for an interpreter for a stack-oriented programming language released under GPL or LGPL license, written in C or Objective-C. ...

Objective-C/Cocoa : Using bindings to access scalar values in an array

So assume there's a class which contains: int someData[EXTREMELY_LARGE_CONSTANT]; What's the simplest way to bind arbitrary integers from this array to textfields in Interface Builder? Can I somehow read/write someData[x] through a KVC method on the class, or do I have to make a textfield subclass or something similar? ...

Proper usage of Application Delegate to send messages.

I have a class that communicates with a server (let's call it 'Downloader'). Sometimes, the server may reject the connection due to a bad login. Instances of this class are used thru-out my program by many different objects, and when the login is rejected Downloader needs to tell the RootViewController to display a login interface. Many ...

Multiple audio recordings

I have a problem. I'm working on a project for my final year. I'm supposed to allow multiple recordings without having them overwrite each other. My supervisor advised me to put it as '.caf' but i'm not sure how to go about doing it. This is part of my codes: (IBAction)play:(id)sender { if (player->IsRunning()) [self stopPlayQueue]...

iPhone Objective-C: Programatically change title of tab bar item in tab bar created using IB?

Right now, I am setting the title in the viewDidLoad of the root view of the tab, which only changes when I click on the tab. I want this to be set before I select the tab. I tried something like: [[self.parentViewController.tabBarController.tabBar.items objectAtIndex:2] title] = @"string"; in the first view that loads in another tab,...

iPhone Crash Log: Failed to Resume in Time

I am looking at my crash logs and noticed "failed to resume in time" Application Specific Information: com.myApp.MyApp failed to resume in time elapsed total CPU time (seconds): 0.680 (user 0.350, system 0.330), 7% CPU elapsed application CPU time (seconds): 0.130, 1% CPU How can I resume in time? ...

[UIApplication sharedApplication] keyWindow] is nil ?

Hi, I want to convert a CGPoint from my UIView to UIWindow coordinates and have realized that UIApplication keyWindow is always nil, how come is this? I have tried convertPoint:toView: method form UIView. Please see this sample code I tried in the view controller in a template of Xcode (View application): - (void)viewDidLoad { [...

How do I create json file from plist file?

I want to create a json file from from exsited plist file. How do I create json file from plist file using programg language (Javascript or Java or Objectiv-c or Python or Ruby)? ...

cocos2d error..

Hi, I am following the tutorial http://www.bit-101.com/blog/?p=2115.In this tutorial i found a project template and go through it to begin.... I have downloaded cocos2d-iphone-0.99.1 add the subdirectory cocos2d to project….but when i built i got 9 error and 4 worning Scene.h: No such file or directory Director’ undeclared (first ...

How to denf a Soap Requesrt in iPhone Objective C?

I'm a newcomer to the iPhone world. I'm working on an application having a login page. I have to send the UIText value of the username and password values to the server with the help of SOAP. I am having no ideas regarding this. Can you help me? ...

kind of NSMouseEntered for a region belonging to the desktop in cocoa

Hello, I would like to be notified when the mouse cursor enters in a particular region of the screen and stays there a certain time. I know there is NSMouseEntered & cie for view you are owning, but is there something more generic which works in all the screen? Thanks and regards, ...

How to draw images of all types on context??

My code: NSArray* fileTypes = [NSArray arrayWithObjects: @"png",@"jpg",@"bmp",@"jpeg",@"gif",nil]; NSOpenPanel* OpenImageDialog = [NSOpenPanel openPanel]; [OpenImageDialog setCanChooseFiles:YES]; if([OpenImageDialog runModalForDirectory:NSHomeDirectory() file:nil types:fileTypes] == NSO...

Unable to retrive data in string

self.pdfPath = [[NSBundle mainBundle] pathForResource:@"iPhone_SDK_License" ofType:@"pdf"]; NSData *htmlData = [NSData dataWithContentsOfFile:pdfPath]; NSString *htmlstr = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding]; It is showing nil in htmlstr, so need some assistance on it. ...