objective-c

Double star argument in objective-c method?

NSURLResponse *response =[[NSURLResponse alloc] initWithURL:requestingURL MIMEType:@"text/xml" expectedContentLength:-1 textEncodingName:nil]; webData = [NSURLConnection sendSynchronousRequest:theRequest ...

iPhone Development - Release an autoreleased object

What happens if I release an autoreleased object? Its an autoreleased UIButton I want to release and the only way to create a UIButton is to use the convinience method buttonWithType:. Will it be released from memory like a normal object? Or should I just let the autoreleasepool take care of it? I wouldn't have made it autoreleased in th...

What's the point of this in objective-c

SomeObject *temp = [[SomeObject alloc] init] self.theObject = temp; [temp release]; Why is it always done that way? Why not self.theObject = [[SomeObject alloc] init]; ...

Objective-C Difference between setting nil and releasing

I've learned that in dealloc you do [object release]; but in viewDidUnload (in a UIViewController subclass) you do self.object = nil. What is really the difference because self.object = nil (we're assuming object is a (nonatomic, retain) property) retains nil (which does nothing) and then releases the old value and then the reference cou...

Why is Xcode telling me this variable is undeclared?

I am getting the below errors in Xcode, I know I needed to declare filteredChildren so I tried adding the line NSArray *filteredChildren to the header file but it only made things worse. What code do I need to add to the header to delcare filteredChildren? ...

A good book about Objective-C 2.0 for an experienced C/C++/Java/C# developer

I'm looking for a good book covering Objective-C 2.0, with some rather specific requirements: It must be available for purchase in ebook form. If it's only available as a paper/ebook combo, that's fine, too - but I want to be able to start reading it immediately after I buy it. Availability on O'Reilly Safari is a big plus, but not req...

Objective C : Release, Dealloc, and the Self reference.

So I thought I had all these questions all figured out. Then all of a sudden i get an error (a crash) i can't figure out. THen after doing research to remedy the crash, i notice everything that I thought i knew about these critical areas are somewhat wrong. Below are 8 questions im just going to shoot out there in hopes of somebody answ...

How to assign copy of object back to original reference?

I have application with following design: Table View that lists documents. And ViewController where document is edited. When editing the document I want to use a copy of object so in case user press Cancel I just throw away the copy. If user selected Save I copy modified document to original. (I can't have all document's fields as prope...

NSScanner Looping retrieving multiple values

I have the following text <select name="username"><option value="177"> Bob1 </option><option value="221"> Bob2 </option><option value="227"> Bob3 </option><option value="164"> Bob4 </option><option value="271"> Bob5 </option><option value="137"> Bob6 ...

Performing lookup on multiple entities using NSPredicate

Hi, I've run into a problem when I've been porting my code over from a SQLite database to Core Data. The data that I'm using comes from a existing database and as such has all the relationships defined using the ID of each of the tables (or entities now that I'm using Core Data). My problem is that I want to query against a single tabl...

NSMutableArray Problem

I am using this line in my code NSMutableArray * NewsFeedArray; NewsFeedArray =[[[NSMutableArray alloc]init]retain]; Where could i release object of NSMutableArray ? and Why we want to release that object... In my project i release the object in dealloc method ..But its take some more time the release the object.... Can anyone help me...

tab bar controller (iphone)

hi, i'm making an application of tab bars...having 5 tabbars.i.e. home,ask,tip,inbox,disclaimer..now the problem is that i want the control to directly shift to disclaimer tab after the launch of application ..right now control shifts to home tab..which is the 1st tab ...

Objective-C Bonjour/TCP Stack

Hi guys/girls, I was wondering if anyone knows of a combined Objective-C Bonjour/TCP stack out there, that would allow me to forget about managing sockets, broadcasting services etc and instead let me just host a service and/or get a list of existing services and connect to one. Then just continue by sending messages either to specific ...

How to use NSzombie in xcode?

my application is crashing very much how do i find the error through nszombie..? could someone tell me step by step guide to use nszombie or valgrind tool to find memory error ,refrence error etc. ...

how to remove an object only if it exists on iPhone SDK?

I want to remove a UILabel from the UIView dynamically. There are some branching and looping, and in the end when I remove it by 'removeFromSuperview' sdk crashes as it doesn't exist anymore, in some cases. [lbl_timer removeFromSuperview]; So what i wanted is simply how to know if an object exists? thanks ...

Multiple UIViewController woes...

I'm relatively new, embarking on my second app, and having major pains with multiple view controllers. I've added the relevant bits of code to the bottom of this email. Here's what's happening: MainViewController: creates RoomViewController, then asks for its view RoomViewController: sets up the room with the items in it (in this case,...

xml parsing in iPhone... question about getting other tags with same names

Let me try to explain as clear as possible what I mean exactly with this question. let's say we use this example http://www.iphonesdkarticles.com/2008/11/parsing-xml-files.html and the xml looks instead of like this <Books> <Book id="1"> <title>Circumference</title> <author>Nicholas Nicastro</author> <summary>Eratosthenes and the A...

how to do smooth scrolling in uiscrollview?

i am using apple's page control sample and showing three different types of views. the scrolling is very slow in device because i am having a uitable a 5 to 7 labels on my view.and everything is updating from database.how do i increase performance of my scrolling behaviour.so that it scrolls very fast in device. ...

iPhone: Sending large data with Game Kit

I am trying to write an app that exchanges data with other iPhones running the app through the Game Kit framework. The iPhones discover each other and connect fine, but the problems happens when I send the data. I know the iPhones are connected properly because when I serialize an NSString and send it through the connection it comes out ...

White bar at the bottom of root view!

Hi, I have two view controllers in the app. When the app starts, the layout of the root view controller's view is just fine. When a button is clicked, the view controller switches to the other one - which shows fine too. However, when the view is switched back to the root view, the contents are shifted UP by about 20 pixels, leaving a ...