objective-c

Objective C: Different behavior variables in header (.h) file vs. implementation (.m) file

Hi there, Could someone please explain the Objective-C difference between myString and anotherString in the following snippet: // In .h file @interface MyClass : NSObject { NSString* myString; } @end // In .m file @interface MyClass () NSString* anotherString; @end @implementation MyClass //... @end ...

UIWebView, Word office document and pagination

When UIWebView loads Microsoft word documents, it just loads it as if it's one whole strip of paper, disregarding the separation between pages. Any idea how to display it properly (pages separated from each other), I'm open to lower level programming, or alternatives to UIWebView for loading Office documents. I'm currently using IPhone...

Show/Hide Toolbars in iPhone app on user touch

How can I make the main content view of my app full screen, and show the toolbar only when the user touches the screen and one more touch will hide the toolbar? kind of like the ibooks app? also how do I make a toolbar transparent? ...

Iphone OS 4.0 : Application is not coming applicationDidBecomeActive ...

Hi, I have recently switched my application to SDK 4.0. Now i am compiling my application with SDK 4.0 with deployment target OS 3.0. and i have facing a strange issue/bug. Some times when my application resumes from background. it does not calls the applicationDidBecomeActive method .... is anyone else facing the issue ? what is the...

iPhone and iPad Rich Text Editor

I need to create a rich text editor (for text alignment, fonts, text and background colours, bold, italics, underlining etc) for an iPhone and iPad app. How should I accomplish. I have heard of storing the data as HTML and rendering it in a UIWebView, but how can I allow the user to edit the data without having to interact with the HTML ...

how to kill a blocked thread

Im still kind of new to objective-c and english,I am wondering the following question I created a sub thread for something,but it may be blocked in somewhere. so I set a timer for 10 secs to kill the sub thread in case that it is blocked. The question is 'how' PS:is it possible to user performSelector:onThread:withObject:waitUntilDon...

error: writable atomic property cannot pair a synthesized setter/getter with a user defined setter/getter

I recently tried to compile an older Xcode project (which used to compile just fine), and now I'm seeing a lot of errors of this form: error: writable atomic property 'someProperty' cannot pair a synthesized setter/getter with a user defined setter/getter The code pattern which causes these errors always looks like this: // Interf...

value of Bool in Objective C

The value of BOOL in objective C is always NO(by default). But recently I encountered a case where the value of BOOL variable was returning YES (by default). Can anybody explain this to me ? ...

Can't get the iPad to vibrate

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); This line of code does not seem to work on the iPad - does the iPad have the hardware required to vibrate? ...

willSave not called in some save operations in Core Data

I have the following piece of code (that may be invoked multiple times or even at the same time because it is in response to some NSURLConnection didFinishLoading method) that should invoke the willSave method for every object registered in the context. NSLog(@"Before save."); NSLog(@"Object count: %d", [[managedObjectContext registered...

Load 100 UIImages

I am busy with an iPhone application. A part of it I load 100 small images from Flickr as an UIButton. The problem is how to handle the memory. it loads around 5-6 mb each time. When I dealloc the view trough navigationController popViewController the memory stays almost the same. What I do now is loop all the images and put the request...

How to get data for UITableViewController in an iphone app

I have a main View that has a table which has it's own controller. How can I pass an array from the main controller to the table controller? (I use interface builder maybe i need to init the view programatically?) ...

what kind of initialization is this called - conceptual?

Hi all, I have this snippet from apple sample code "LazyTableImages" . In the code below they are initializing the IconDownloader class . So what kind of behavior is this . *************************This Line ****************************************** IconDownloader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath]...

Where should I create global variables for targets

I have an Xcode project with two targets for two different apps. There are a lot of #ifdef statements sprinkled throughout the code #ifdef PROJECT_ONE NSArray *dbKeys = [[NSArray alloc] initWithObjects: @"name", @"zip", @"phone", nil]; #else NSArray *dbKeys = [[NSArray alloc] initWithObjects: ...

UIView, hows it working?

Can someone just clarify how UIView works in this context? Is it just part of the view controller (i.e. the view that is part of my ViewController.xib). I was puzzled for a second as it felt like I should have been declaring it somewhere, I wanted to call beginAnimations but was not sure what to call it on. @implementation ViewControlle...

UIWebViewNavigationTypeLinkClicked not works for "location.href" links

I have a UIWebView with a UINavigationBar, that shows a UIButton to turn back to the previous page. This code works well with link of type <a href>, but not with location.href. How can I do to make it works? - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)r navigationType:(UIWebViewNavigationType)navigat...

abstract detailviewcontroller text in its mainviewcontroller iphone?

In my application a maintableviewcontroller and its detailviewcontroller which have textfield & button(save) when i click on button i want to save textfield data into maintableviewcontroller'cell which shows the detailview for this achieving what i do explain in detail? ...

Using a global variable vs reading and writing to file

I'm afraid this is a bit of an abstract question. I'm basically writing an iPhone game which revolves around a Pet, a bit like a tamagotchi for example. I've created a Pet object, which contains all the data relevant to the Pet's status. The rest of the program accesses the Pet's data and performs relevant actions. The pet is saved to ...

Corners from CGContextAddArc are too dark

Hey all, i have little problem with my code. I want to add a footer to a uitableview-section, but that's not my problem. My problem is that i want to have rounded corners on my footer-view, but not on all corners, just the two on the bottom. But the corners are just too dark and i don't know why... Heres my code: - (void)drawRect:(CG...

Objectiv-c Soap request to a .Net Webservice

hi, i am programming a client in objectiv-c for the iphone which should use Soap for the communication with the .Net server. I have a big problem and hope that somebody can help me. I send a request with no errors and get a response, but a false response. in my request i put paramters calles "wo"(= where) and "was" (=what), but the resp...