I'm trying to do something basic to understand threads with a counter that just increments when a button is pressed, and every time the button is pressed, a new thread incrementing the same counter starts. Then I have a stop button to stop a thread that is running. How can I tell how many threads, or which thread is running? Here is m...
Hello all, I have some problem with JSON parsing. When I hit URL, I've got JSON response like this:
//JSON 1
{ "data":
{"array":
["3",
{"array":
[
{"id":"1","message":"Hello","sender":"inot"},
{"id":"2","message":"World","sender":"inot"},
{"id":"3","message":"Hi","sender":"marza...
I am having trouble removing objects from nsmutable array. Here it is.
NSURL *url = [NSURL URLWithString:@"http://www.lockerz.com/dailies"]];
NSData *datadata = [NSData dataWithContentsOfURL:url];
NSString *removeForArray = [[NSString alloc] initWithData:datadata encoding:NSASCIIStringEncoding];
NSArray *theArray = [removeForArray co...
I have a UITableViewController (OnTVViewController) who's viewDidLoad is similar to below (basically parses some XML in the background and shows an activity indicator while this is happening).:
- (void)viewDidLoad {
OnTVXMLParser *xmlParser = [[OnTVXMLParser alloc] init];
/* Runs the parse command in the background */
[NSThread detachN...
Suppose I already have an OS X app which syncs its data using Sync Services with MobileMe. Is there an way to make my iPhone/iPad app to sync (using MobileMe or not) the data using what I already prepared for the Sync Services?
I guess Apple already has the implementation inside iOS because iPhone/iPad does sync Safari bookmarks, but i...
I have a custom iPhone application which doesn't rely on UIKit in any way (it is not linked to UIKit). This means that I'm not using UIApplication and therefore not calling UIApplicationMain.
The problem is that when I create a timer it never fires. The timer is created like that:
[NSTimer timerWithTimeInterval:10 target:self selector:...
I have a simple question. How do I get iPhone's battery level?
[UIDevice currentDevice] batteryLevel]
Simple enough? However there is a little catch - I can't use UIKit. Here is what I wrote so far, but I don't think it works:
// notification port
IONotificationPortRef nport = IONotificationPortCreate(kIOMasterPortDefault);
CFRu...
I'm working on an universal iPhone app, but a few user settings don't make as much sense on the iPad.
Can I specify a separate Settings.bundle or Root.plist for use on the iPad?
Thanks.
...
I am fairly new to Objective C and iOS programming but am constantly trying to learn as much as I can.
I am about to start an iPad project which will involve storing large amounts of data which will need to be exported to one extremely large excel spreadsheet.(it's for a friend....they currently enter massive amounts of data into excel ...
Hi,
I have an entity called Task in my Core Data model. The Task entity has a transformable attribute called date. The class of the date attribute is a class called TDate (which conforms to NSCoding, therefore being a transformable attribute). TDate has a property of type NSInteger called month.
In my NSFetchRequest I want to get all ...
I'm following the example Navigation View template with core data in the latest iOS SDK.
In the rootViewController.m file I see this in the @synthesize line:
@synthesize fetchedResultsController=fetchedResultsController_, managedObjectContext=managedObjectContext_;
Where the header file is:
@private
NSFetchedResultsController *fetch...
Hi,
** solved :-) (see example on bottom) **
could anyone give me a hint on how to force a view controller to switch back
to portrait orientation after returning from a subview which was in landscape
mode?
It should work similar to the Photo-App. When viewing an image in fullscreen mode,
the view rotates on changes of the device orien...
I'm running into problems trying to use a NSFetchedResultsController without a corresponding UITableViewController.
According to Apples documentation:
"NSFetchedResultsController is intended to efficiently manage the results returned from a Core Data fetch request to provide data for a UITableView object."
So I first researched whethe...
I'm writing iOS Objective-C code. I prefer
__weak MyClass *myWeakIVar;
to, e.g.
MyClass *myWeakIvar; // weak
Not only does it read better to me, but if I ever use this code on a garbage-collected platform, I get the benefits of the __weak directive. Are there any downsides to this? Put another way, is it presently equivalent to a n...
I'm currently beta testing an application I'm working on. I've entered data into this app that I don't want to lose, however the current state of the app is that it will not even start (doesn't even generate crash log or connect to debugger).
I would be OK just deleting it and re-installing if I could get the data in the SQLite databas...
Whenever my method sets an object to onTouchEventReceiver, it gets lost when another method is called by another thread.
//In header
id onTouchEventReceiver;
SEL onTouchSelector;
- (void) setOnTouchSelector:(SEL)sel withObject:(id)obj
{
NSLog(@"setting obj to %@",obj);
onTouchSelector = sel;
[self setOnTouchEventReceiver:ob...
I have a UITextField in my iPhone app. I know how to make the text field select all of its text, but how can change the selection? Say I wanted to select the last 5 characters, or a specific range of characters, is that possible? if not, can I move the lines marking the beginning and end of the selection, as if the user is dragging them?...
This is what Instruments is pointing to.
students = [[NSMutableArray alloc] initWithArray:[course.students allObjects]];
I'm releasing the array in dealloc. In the rest of my code I'm only calling the array and I'm not alloc'ing it again. I've also tried filling the array via fast enumeration and I get the same problem.
...
Dear Developers,
I am developing an iphone app that has a single View containing A UILabel. The UILabel displays strings from within a plist that is structued as follows;
Root................................................(Array)
.............Item 0.................................(Dictionary)
.........................Question.........
What needs to be changed to make an iphone app compatible on the ipad?
I know the icons etc must be different etc. but in terms of code?
...