objective-c

Ownership regarding to returned Quartz objects

I have recently asked about autoreleasing a returned quartz object: http://stackoverflow.com/questions/2819548/autorelease-for-cgmutablepathref Dave DeLong answered my question that there is no autorelease for quartz (or any NS foundation objects) and I should use the Create Rule. However the naming convention on the document says, ...

iPhone WebApp Question

I have this code- /** Save the web view as a screenshot. Currently only supports saving to the photo library. / - (void)saveScreenshot:(NSArray)arguments withDict:(NSDictionary*)options { CGRect screenRect = [[UIScreen mainScreen] bounds]; CGRect imageRect = CGRectMake(0, 0, CGRectGetWidth(screenRect), CGRectGetHeight(screenRec...

How to localize all strings in an array

I have a dynamic array of strings, the elements of which I would like to localize. Is there a way to localize the strings without iteration e.g. something like using "makeObjectsPerformSelector". Thank you ...

Return the name of the class instance with the highest 'someValue' instance variable

I have a brand new Objective-C class called test. The test class has an instance variable called someValue, which contains an integer. I create 5 instances of the test class called aTest, bTest, cTest, dTest and eTest. The appropriate synthesize and property declarations for someValue are in place. Is there a clean way of returning th...

UISearchBar and UINavigationController

I have an .xib file connected to a ViewController, which is init'ed as the root controller of an instance of UINavigationController in my appDelegate. In that view, I have a UISearchBar and a UITableView below it. When the view loads up, there's a navigationBar at the top, followed by a ~20 pixel gap, and then the UISearchBar, and th...

Iphone SDK 4 sms composer

Hi Have anyone tried to use the SDK4's SMS composer? If anyone's got some reference or source code please put in here Thanks ...

UIView does not move a subview when a animation block is after it.

I have this UIView class. It has 4 Views in it: self.view. The view of the class itself. Above that twitterButtonView that holds: A UIImageView of a button. Above that a hidden view of the back of the button. The self.view has a frame of (30, 380, 68, 66); I want to be able to tab the button and then it scales up accompanied by ...

Testing Async downloads with ASIHTTPRequest

I am writing a simple library using ASIHTTPRequest where I am fetching URLs in an async manner. My problem is that the main function that I have written to test my lib exits before the async calls are finished. I am very new to Obj C and iPhone development, can anyone suggest a good way to wait before all the requests are finished i...

How can I make my tableview enter editing mode?

Hi, for some reason I can't get my tableview to enter editing mode. It's a little harder than it might seem because I'm using some open source code to make a calendar (iCal esque) with a tableview under it, and it's not quite as straightforward as just using a regular tableview. Basically, I have two classes. One (let's say Class A) is...

Objective-C Syntactical Question

Just doing some research on searching for a character or word within a NSString and I came across this code snippet (which works like a charm): return [sourceString rangeOfString:searchString].location != NSNotFound; Am I right in thinking that the above code is functionally identical to: NSRange range = [sourceString rangeOfString:s...

How can i get the keys of NSMutableDictionary that start with a certain string

I have a json response coming and i need to get all the values whose keys are a particular string... for e.g : www_name, www_age etc are coming in the nsmutabledictionary as keys now i want to search all those values having "www_" as their part of the string. ...

How do I loop nodes using NSXML on the Mac and change each node's text value.

Hello - have been stuck on this for days now- How can I loop every node in an XML document and change the text value of the node. For example go from this: <root> <node1>some text</node1> <node2> <node3>some more text</node3> </node2> </root> to something like: <root> <node1>updated text</node1> <node2> <...

objective-c iphone XML parsing one element

I know that when parsing XML with objective-c most of the time you use NSXMLParser. But what if you only need to read one element. Using NSXMLParser sounds like an overload to me. The issue is that flickr API doesn't use JSON as response when uploading an image. So my response now is: <rsp stat="ok"> <photoid>4638598522</photoid> </rsp...

Putting methods in separate files

I have a class (MyClass) with a lot of methods. Consequently, the .m file has become quite difficult to read. I'm relatively new to Objective-C (having come from REALbasic) and I was wondering if it's possible to put some of the methods in MyClass into different files and then include them in the class. How would I go about this in Xcode...

Is there a way to make an executable from an Xcode project?

Hello, all! I feel it's quite a naive question I'm going to ask. Excuse me if it's foolish. I have made an iPhone game using Cocos2d, Box2d and OpenGL. I want to show the game to a potential employer for demonstration purposes, without giving him the source code. How can I make a .exe or .app file from the Xcode project? I've searched...

iPhone 3.1 SDK: UIViewController category is affecting ALL ViewControllers

Hi everyone, iPhone SDK question for you. I've created a UIViewController category to shift a view up when UITextFields are being edited and the keyboard appears, blocking the fields. I found the code online and no doubt you iPhone gurus are familiar with it. The interface looks like this: @interface UIViewController (Shiftable) ...

How to read the character from a string seperately in iphone sdk?

Hi guys, I need a help from ur side for this. actually I am having string like: NSString *str = @"Helloworld.123 456"; I need to get the characters one by one from the string and check whether it is an numeric value. Is there any predefined method for this?? can anyone help to get out of his. Anyone's help will be much appreciate...

Can someone explain to me what (NSString *) means with Obj-C?

Hello, I just started with Objective-C and I would like to understand the meaning of the following lines of code as I see it everywhere in objective-c but I'm not quite getting it 100%: - (id)initWithName:(NSString *)name; I understand that the above line is a instance method passing one argument, what I don't understand is (NSString...

warning: unable to read history from "/dev/null/.gdb_history":

I get this warning when I start debugging. Does anyone know why it's looking in /dev/null for my history. I know it's some path which was mis-set somewhere but I do not know which? Any help. How can I see which environment parameters are passed to GDB by XCode? ...

displaying in a UITableView CoreData objects ordered in a Set

Hello, I have difficulties displaying objects coming from CoreData in a tableView. I have 2 sorts of entities : Sample and SampleList. What is important to know is that a SampleList has an attribute sampleSet which is a set of samples (entity of Sample) First I succeeded in displaying every SampleList. Here is viewDidLoad: NSFetchRequ...