objective-c

Button is not visible at runtime(cocoa objective-c) ?

I am trying to load nib at run time. I am using Button control & binding it to one method & outlet. But problem is that when i load it run time it not display button. Also When i click on position where i placed button in interface builder, it executes binded method. I don't understand what is happening ? ...

How to solve a deallocated connection in iPhone SDK 3.1.3? - Streams - CFSockets

Hi everyone, Debugging my implementation I found a memory leak issue. I know where is the issue, I tried to solve it but sadly without success. I will try to explain you, maybe someone of you can help with this. First I have two classes involved in the issue, the publish class (where publishing the service and socket configuration is ...

Conditionally overriding a system method via categories in Objective-C?

Hi Is there a way to provide a method implementation (that bears the exact same name of a method defined by the framework) only when the method isn't already defined in the system? For example method [NSSomeClass someMethod:] exists only in Mac OS X 10.6 and if my app runs in 10.5, I will provide that method's definition in a category....

Issue with overlapping annotations (MKAnnotationView) on map

In my iphone application, I'm using MapKit with MKMapView and custom MKAnnotationView. The problem is when annotations overlap on map (in my app, annotations are photos and those photos may overlap) and when you tap on the annotation that appears on front, it's another annotation (on back) which receives the event (seems to be random). ...

How to remove subviews to release more memory

I have UIScrollView with number of subviews. Each subview is custom UIButton with UIImage. When I load more and more subviews, more and more memory is used. But I remove invisible subviews by removeFromSuperView method. Subviews are removed and stay invisible, but Im afraid that no memory is released. UIImage is image downloaded from int...

how to keep the UIActivityIndicator "floating" above the UITable?

hello! I have a problem with the indicator, my intention is to show "waiting" indicator floating above the UITable when use clicked one of the UITable row, and during the waiting that user still be able to scroll down the table. But the problem is, when I scrolling the table down, the indicator is moving too! can anyone help on this?? ...

adding options to IKSaveOptions?

I have an ImageKit program that needs to be able to save images, so I'm using the IKSaveOptions accessory view, to allow the user to choose a file type, etc. However, I want to remove some of the options, and add a checkbox to the panel for TIFFs. Alternatively, I want to add a type of file. However I can't figure out how to do this. I ...

Objective-C: initWithName:(char *)string

How would you read this in English? My concern is with the pointer. Is that pointer associated with char or with string? Thanks in advance! ...

NSMutableDictionary is adding quotes to keys and values - why?

I'm trying to add some additional key/value pairs to an NSMutableDictionary, using: Tag *tag1 = [results1 objectAtIndex:0]; [resultsDict setObject:[tag1 retrieveTextUpToDepth:1] forKey:@"image_url"]; Tag *tag2 = [results2 objectAtIndex:0]; [resultsDict setValue:[tag2 retrieveTextUpToDepth:1] forKey:@"majority"]; This adds the k/v pa...

Do I need to release the temp Object from this example?

-(IBAction) testTemp: (id) sender{ id tempObj; tempObj = otherObject; //the otherObject will be released in dealloc method; [tempObj doSomething]; } As you can see, I use the tempObj for temp use. I won't use it after the user quit this method, should I need to release the tempObj? and why? ...

Objective C / iPhone: How to add a timer to let the text update?

I want to write an application that allow user to count down the time. The time will be displayed using label. I want to update the label every second, how can I do it? or which API is suitable for me to do this? thz in advance. ...

UIViewController shows two UITableView

Hi, I have a weird problem. I'm subclassing UIViewController and adding a tableView property in which I load a UITableView. Now I'm adding this UITableView to the parent's subviews. Works fine but I get TWO TableViews. One standard styled TableView and one the way I wanted it to be on top of the standard one. Both contain the correct d...

Difference between char *foo vs (char *)foo in Objective-C

What is the difference between char *foo and (char *) foo in Objective-C? Here is an example for both scenarios: 1. @interface Worker: NSObject { char *foo; } 2. - initWithName:(char *)foo ...

How can I create a SecKeyRef object (in iPhone sdk) from a already generated public key file?

I am trying to implement RSA encryption logic in a iPhone app. I have created two seperate public and private key file using Java API. As per our requirement we will have to encrypt few secured data(inside iPhone client app) using previously generated public key file before sending it to J2EE based server. How can I create SecKeyRef obje...

Who to access a UIButton using tag and button change image?

I need to change the images on a matrix of UIButtons, and the only thing I know of to address the buttons, is the tag. But I can not find a way to actually us this identifier. The buttons are created programmatically during viewDidLoad. Here is the code for creating the buttons: #define N_ROWS 4 #define N_COLS 3 int N_IMG = 0; ...

iPhone SDK - (void)viewDidLoad { } - Show Progress

I have a long - (void)viewDidLoad { } function that uses the internet to load a page, and whenever the application loads the URL, the screen is black. I have a UIActivityIndicator setup to show that the address is loading, but I don't know how to prevent it from seeming as if the application is not responding, and I don't want to show t...

iPhone disk image loading in tableView (Photo application like)

Hello, I have a question about the best performance approach... Basically I have a UITableView, with cells and 4 images inside the cell. (The similar Photo Application thumbnail preview); 24 images seen... Images in cells are loaded asynchronously from URL address and when downloaded they are saved in Documents directory on iPhone. ...

Mixing garbage collected framework with normal code

I know my way around Objective-C and I have experience with garbage collection from .NET, although I never used it in objective-c. I write my code without using it. Now I'm thinkig about using one of the frameworks (Blocks) which is available as GC-only. My question is - can I still use the framework without any changes to my current no...

wait for CLLocationManager to finish before tweeting

I want to wait for latitude.text and longtitude.text to be filled in before sending a tweet, this code works fine, but I would rather not put the tweeting part in locationManager because I also want to sometimes update the current location without sending a tweet. How can I make sure the txt gets filled in before sending the tweet withou...

Printing an NSDocument

I'm trying to print a document. The document is an array of NSImageReps, or a single NSPDFImageRep, which has multiple pages. I'm having trouble figuring out how to use the NSPrintOperation class to print this. The NSPrintOperation seems to need an NSView to print. Do I need to manually add each image into the view at a calculated pos...