I am developing iPhone Application.
MyApplicationData.h
#import <Foundation/Foundation.h>
@interface MyApplicationData : NSObject {
NSMutableArray* appData;
}
@property (retain) NSMutableArray* appData;
-(void)loadData;
-(void)addAppDataItemPrice:(NSString*)price itemCategory:(NSString*)category itemDate:(NSDate*)date;
-(void)f...
Hi all
Background:
I have a UITableView showing an image in each cell. These images are all part of a big pdf-file. So what I am doing is actually rendering little pdf-parts in those UITableViewCells, each cell displaying just one piece. Therefore I add a UIView to the contentview of the cell and render the view on demand.
Rendering the...
Want to code a key pad for an calculator. What I want to make is:
Keypad with keys from 0 to 9
Special keys: + - * / . =
My conceptual so far:
When a numeric key is pressed, convert it's int value into an string and append that string to the bufferString. That way the input value gets built up. When the user presses . (to make a float...
In a global.h file I declare
dataManager *IdataManager;
Then later when the program initializes I allocate and initialize the variable, and use it in several different views as a means of accessing a set of data that gets downloaded when the app starts up.
Recently I noticed when I pull up one of my views, close it, and then open it ...
Hi, is there any objective C API or object that can give me access to the iCal and its events?
I need to read the calendar events for a given date and optionally set a new event.
The code is either plain C or objective C (in the GUI version of the program). I'm using xcode on a mac os 10.6.
Sample code is greatly appreciated.
...
Have got an
NSString *str = @"12345.6789"
and want to find out if there is that "." character inside of it. I'm afraid that there are ugly char-encoding issues when I would just try to match an @"." against this? How would you do it to make sure it always finds a match if there is one?
I just need to know that there is a dot in ther...
Basically I have a hierarchy of locations: country, state/prov, city.
I want to present an "Add Location" modal table using a delegate.
I realize the best way to do this is to present my top level elements in a TableView, and if they are selected, I want to go down to the 'next' level. Any of the locations however, on any level should...
I'm trying to get total salary for the whole company by:
NSNumber *totalSalary = [company valueForKeyPath:@"[email protected]"];
But I keep getting this error, "-[__NSSet0 decimalValue]: unrecognized selector sent to instance 0x10031eb00".
I think I'm doing something wrong but I'm not sure where.
...
I have a file with contents something like this:
INSERT INTO table VALUES (NULL,'° F','Degrees Fahrenheit');
INSERT INTO table VALUES (NULL,'° C','Degrees Celsius');
Now, to parse this, I have something like this:
NSString *sql = [NSString stringWithContentsOfFile:filename];
Printing this string to the console looks correct. Then,...
I was wondering when you remove an object using removeObject in an array if that removed object is handled properly. Would the object being removed be released?
...
Hey guys,
I'm having a problem with doing a sendSynchronousRequest failing. It only fails after I try to get the current geolocation and the user hits "Don't Allow". And it only happens under 3.1.2. (As far as I can tell. It works fine in 3.0.1.)
Here's what I do:
I set up a very basic test app, that has almost nothing in it. In appli...
Hey All,
I was wondering what I should use to display an image on screen every time the user presses a button. I am using Objective-C/CocoaTouch on the iPod Touch. I would like to pull these images from an array I have set up and place them on the screen when the button is triggered. I feel dumb asking but any one that can point me in ...
on iPhone NSLocalizedString returns the string in the language of the iPhone.
Is it possible to force NSLocalizedString to use a specific language to have the app
in a different language than the device ?
...
I recently purchased a Magic Mouse. It is fantastic and full of potential. Unfortunately, it is seriously hindered by the software support. I want to fix that. I have done quite a lot of research and these are my findings regarding the event chain thus far:
The Magic Mouse sends full multitouch events to the system.
Multitouch events a...
I need to change the background of one of my Views based on a property that will be set when the View is initialized.
Is this possible?
I've got the background set as a UIImageView and if I set it to an Image in Interface Builder it works, but I can't change the background programatically.
Here is the code I'm using (I based it off a tu...
If I set a mutable string's value to a value from an array, and use the following code to manipulate it:
NSMutableString *theCountry = [listItems objectAtIndex:3];
theCountry = [theCountry stringByReplacingOccurrencesOfString:@"\"" withString:@""];
I receive the warning "warning: assignment from distinct Objective-C type" after the s...
What is the most memory efficient way to loop through an NSMutableArray of custom objects?
I need to check a value in each object in the array and return how many of that type of object is in the array.
...
The goal is to generate an NSString chars in length and assign each string to an array. I'm getting stuck on what I need to do with my algorithm to get the correct result. Here's the sample. The result I get is the same randomly generated string added to my array 26 times instead of 26 DIFFERENT strings added.
I've thought about de...
Most of the documentation that details how to get started with JNI described how to build a new JNI application using X-Code. Can anyone link me to a description of how to use JNI to interface with Objective-C in an existing application.
...
Hello,
I have been developing with objective C and the Cocoa framework for quite some time now. However it is still not absolutely clear to me, when am I supposed to set object references to nil. I know it is recommended to do so right before releasing an object that has a delegate and you should also do so in the viewDidUnload method f...