objective-c

Cant set two NSStrings into one UITextView

Hi, I want to get NSString * test1 = @"one"; NSString * test2 = @"two"; to my UITextView. I wrote this: uitextview.text = (@"%@, %@",test1, test2 ); but the UITextView only gets the second NSString... Why? ...

Wrap Text in UITextField?

Does anyone know how to wrap text in a UITextField? I am using Cocoa/Objective-C in Xcode for my iPhone project, and I can not seem to find a way to do this... ...

Getting the string value from a NSArray

I have a NSArrayController and I when I get the selectedObjects and create a NSString with the value of valueForKey:@"Name" it returns ( "This is still a work in progress " ) and all I want to have is the text in the "" how would I get that? also, this my code: NSArray *arrayWithSelectedObjects = [[NSArray alloc] initWithArray:[...

Swap iphone resources in SVN working copies

We have a development environment with a lot of different settings for our sandbox instances, staging servers, and production environment. In our iphone code, we keep these settings organized in plists. Anyone have references to best practices for managing the swapping out of plists based on the current environment? Without having to ...

Objective C terminology: outlets & delegates

I'm having issues understanding the concept of outlets how the iPhone deals with events. Help! Delegates confuse me too. Would someone care to explain, please? ...

Separate strings and include separating character in one of the returned components

Hi, Say I have the following string "Center-World" and I want to separate this string in two different strings but I want the dash to be part of "Center". With the code below I got a string with ["Center","World"] and I want something that returns ["Center-","World"]. Here is my code: NSCharacterSet *stringDelimiters = [NSCharacterSet ...

Deleting a object NSArrayController

I have a NSTableView which gets it's data from a NSArrayController and I need to delete the currently selected row, I know NSManagedObjectContext has a delete deleteObject: method but I can't think of how to deleted it from the NSArrayController? ...

Game crashes after being stressed.

Hi everyone. I am in trouble with my game now, it keep crashing when I stress it too much. Meaning I crazily sliding, moving, or tapping my fingers on the screen, it will crash. The crash has no rule. I tried to detect, in the console log shows the message low memory warning. I know it is about the memory stuff, but I am using Cocos2D to...

Am I updating my NSArray that's bound to an NSTableView right?

I have a pretty standard setup where I have an array in my controller that I'm binding to an NSTableView. When I add an object to this array with the UI, I add elements by copying the array to a mutable array, adding the contents, then copying it back. I saw this idiom somewhere, but I'm not really sure where, or whether this is actually...

NSURLDownload Cancelling

So I am using NSURLDownload in a program, and it requires that I give the user an option to cancel the donwload. I tried using the -cancel method but it only works up until the device starts receiving data at which point i cannot find a way to stop it. any ideas? ...

I am getting one error while using the mgtwitter engine my app

I am getting the error for using the NSImage in this function in my appcontroller like expected ')' before NSImage. - (void)imageReceived:(NSImage *)image forRequest:(NSString *)identifier { NSString *path = [[NSString stringWithFormat:@"~/Desktop/%@.tiff", identifier] stringByExpandingTildeInPath]; [[im...

Need help understanding how IB-created UIViews are added programmatically

I am in a situation where one of my ViewControllers has many special cases and I need an elegant way of handling them. The general idea is that the bottom half of my View is identical in each case. The top half changes for each case. In accordance to DRY, I want to avoid make copies of my ViewController for each special case and changi...

Is NSFetchedResultsController also caching the record set itself, or just some meta data about table display stuff?

I fear my english is too bad for the documentation ;) it feels like they try to say, a NSFetchedResultsController also caches the record set itself, hence it may query some lame web source for half an hour and then the next time display that data super fast from the cache? Or does it just cache some data about "how to display the stuff"?...

Cocoa and Objective-C++

Hey guys! I think I understand how Objective-C++ works in relation to Cocoa, and I am fairly versed in the basics of command-line C++ but sort of afraid to try mixing it with Objective-C. I can create a GUI with Interface Builder in Xcode, and even make classes (.h and .m files) for the interface automatically. The outlets, maybe action...

Trying a tiny winy 3D classes for iPhone

Ok, I'm trying to save some time creating some generic classes to draw objects in the 3D space. I created a Object3D class with the properties x, y, and z. The thumbnail3D is a "son" of Object3D using inheritance. Vertex3D is a struct with a GLfloat for every coord. The problem is when I try to compile the method initWithPosition:( V...

what is the difference between self.navigationController and Delegate.navigationController

i can use MyFirstAppDelegate * Delegate = (MyFirstAppDelegate *)[[UIApplication sharedApplication] delegate]; [Delegate.navigationController popViewControllerAnimated:YES]; or [self.navigationController popViewControllerAnimated:YES]; So what is the difference between both ? Please answer me ...... Thanks in advance.. ...

Sorting array of objects by two criterias?

I have an array of objects that i want to sort by two keys. The objects lets say are of type Student and the properties that i'm intrested in for my sort are grade and name. Student { double grade; string name; ... } How can i sort the objects first by grade and then by name? so for example if i have the list: Tom 9.9 And...

Can I show/hide a certain cell in an UITableView depending on the state of another cell?

I have a UITableView with style "Grouped" which I use to set some options in my App. I'd like for one of the cells of this UITableView to only show up depending on whether another of this UITableView's cells is activated or not. If it's not, the first cell should show up (preferably with a smooth animation), if it is, the first cell shou...

Read UDID from Iphone with javascript on mobile safari

How can I Read UDID from Iphone with javascript on mobile safari? ...

Application build on Xcode 2.4 with mac 10.5 sdk is not getting invoked in Mac 10.3.9?

Hi, I have build an application with xcode 2.4 (universal binary with sdk10.5) on Mac 10.6, when im invoking the application in mac 10.3.9 the application is not getting invoked. Its workin in 10.4 and above version? Can someone suggest me on this.. ...