objective-c

Background app drains too much battery

I have developed an application for iPhone that runs in the background with GPS mode on. I need to ask the server if there are any new tasks for the user? Fir this purpose, I have added the code in the didUpdateToLocation method. Now the problem is that it consumes the battery very fast. Please guide me how to avoid the battery consumpt...

Objective C: What is the best way to create and use a dynamic boolean array?

I have been struggling with the best way of creating, accessing and updating values from a dynamic boolean array for more than a week now. @interface myDelegate : NSObject { NSMutableArray *aShowNote; } @property (nonatomic, copy) NSMutableArray *aShowNote; This is how I have initialised my array: NSMutableArray *aShow = [[NSMutab...

How can I support iOS 3.0 and not iOS 3.2

I have set my base SDK to 3.0 but don't want my app available for iPad (3.2). How can I accomplish this? ...

Best method for handling the display of a lot of text.

Hi guys, I have a screen where I am going to display a lot of text. I have the text saved in an array of strings. 15 Headings and 15 body texts. I was wondering what is the best method of handing this? Convert it to HTML and use a webview or maybe some kind of textview ? I was thinking a table could work too possibly, though I am prob...

Find App installed or not

Hello All , How to find out the app installed or not in device.Thanks in advance. Regards, Arunkumar.P ...

Memory leak in a small code with dealloc

Hi All! Assist me please, is this code correct? I mean, do we really need a dealloc method in this class, and why do or don't we? Will be a memory leak if we don't use dealloc here? Thanx! #import <Foundation/Foundation.h> @interface MyData : NSObject { @private NSString *name; NSString *surname; NSString *email; ...

Apply loop on accelerometer reading ?

Hello All, Actually i want to apply a loop on accelerometer, means i want to start a accelerometer on behalf of loop. if i want to start loop one then want to perform accelerometer reading one time. if loop will run twice then want to run accelerometer twice. But it not happens. What should i do to control accelerometer. Have a quick ...

how to change the color of the tabbarcontrol

Can any one help me out in changing the color of the tabbar controller in the iphone application. ...

UITableView fixed header

How to disable scrolling for UITableView header, to be always visible? (To have column titles.) ...

How do msn like apps work in iPhone?

How is the msn messenger app developed? What I want to know is how does the app gets ti know that a new message is received, even while running in the background. Please refer any code snippets or tutorial. Many thanks in advance. ...

Creating a webview programmatically and displaying NSStrings inside the view.

Hi guys, I have created a web view programmatically. This works perfect. The code is below. What I need to try and do now is inject NSStrings into it. I have an array of 30 strings. 15 Headings and 15 body-texts. Is it possible to get these displayed inside the webview? I'm guessing I need to change them into a HTML, imaybe reformat t...

NSInputStream getBuffer: length: doesn't work?

Hi there, I really would like to use the getBuffer:length: method of an NSInputStream. After a lot of research i couldn't find a valid example that uses this method, because most people really needed read: maxLength:. So now some facts on the surroundings: * I'm developing an app for the iPhone, iOS 3.1.3 * I've established a network c...

How to slide(push) controls down/up in a View?

Hello folks! I have a button which when pressed, should push the controls below it down and show textFields on the space freed. Basically, just changing the position of these controls in an animated way. Any ideas/tips on how to do that? I tried the code in: How to Make a UITextField Move Up When Keyboard Is Present But couldn't get i...

UIInterfaceOrientation bug ?

In my iPhone app I need to detect the current orientation and I have to determine if I'm in portrait or landscape. I use this code: UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { NSLog(@"port...

Problem with MKAnnotation image property

Hi all, I am implementing a MKMapView based application. In that I am using a custom image instead of displaying a pin by using MKAnnotationView.Image property. It is working fine. But I had a problem with pin display it is showing in the ocean. When I used default pin it works fine. I don't know what is the problem. Can you guys please...

Overriding layoutSubviews when rotating UIView

When rotating a scroll view inside a UIView, the scroll view doesnt position correctly using its default autoresizing behaviour. Thus, when rotation occurs, in willRotateToInterfaceOrientation i call [self.view setNeedsLayout]; and my layoutSubviews method is as follows: - (void)layoutSubviews { NSLog(@"here in layoutSubviews"); }...

How to make sure your dealloc code is called on application termination?

According to NSObject's documentation: Important: Note that when an application terminates, objects may not be sent a dealloc message since the process's memory is automatically cleared on exit --- it is more efficient simply to allow the operating system to clean up resources than to invoke all the memory management ...

Dynamic properties in Core Data

Hi All, I am new to ObjC and newer still to CoreData. I have tried to find an answer to this around but never got quite what happens to me. I initialize a Managed object in my controller's loadView like this: NSError *error; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescript...

How to display list of values in Iphone programming except using UIPickerView?

Hi, In my app I have four fields and each of them is list of values. Now if i use a UIPickerView with 4 components then the whole View becomes too congested and ugly for the user's liking. Is there any better and cleaner way to display these list of values? Please Help & Suggest. Thanks!! ...

NSMutableArray out of scope problem

Hello all! I'm new to objective-C. I want to use NSMutableArray to store some objects i will access later. I've got the interface: @interface ControlWheel : RotatableObject <LeverSubject> { NSMutableArray *subjectArray_; } -(id) initWithCWDef: (ControlWheelDef*) def; -(void) addSubject: (id) subject; @end Here is the implementation...