I have a class MyClass. It has instance variables passedInVar1, passedInVar2, etc. whose values will be passed in from the object that requests the initialization. It also has instance variables decodedVar1, decodedVar2, etc. that will be decoded from an archive -- or set to a default value if there is no archive.
According to Apple,...
Hello, when I have the fallowing code to read a binary file:
NSString* file = [NSString stringWithUTF8String:fileName];
NSString* filePath = resource ? [[NSBundle mainBundle] pathForResource:file ofType:nil] : [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathCompon...
A followup to this quesiton:
http://stackoverflow.com/questions/2944581/forcing-reload-of-view-when-returning-from-flipsideview-of-utility-application
When returning from the flipside view, I'm calling
NSArray *annotations = [NSArray arrayWithArray:[mapView annotations]];
[mapView removeAnnotations:annotations];
To remove all the pi...
I'm having a problem when scrolling down and up a tableView on iPhone it gets kind of stuck while loading the images i need a method to preload the images so the scroll can be fluid or load the images 'till the scroll event stops...
any help on this?
...
i want to have a background thread in my app that changes an image every 5 seconds for as long as the app is being run. Can someone point me in the direction of how this works? I am new to threads.
...
Hello, I am making a twitter application for iPhone, I am trying to add a button which will open Safari, and take the user to their twitter homepage. I have a textfield called username, so the following code does not work, hopefully someone will be able to help me out.
-(IBAction)viewAccount {
[[UIApplication sharedApplication] ope...
Hi:
For executing a shell command I'm using system("ls"); command. Is there any way I can read the output?
...
I'm trying to create a simple custom UIView wich contain a string drawn with a single font, but where the first character is slightly larger.
I thought this would be easily implemented with two UILabel:s placed next to eachother.
I use NSString sizeWithFont to measure my string to be able to lay it out correctly.
But I noticed that th...
So far, I've been using
[button1 addTarget:self action:@selector(newAction) forControlEvents:UIControlEventTouchUpInside];
which adds an additional action (I think). How can I replace the initial action with a new one?
...
I have a UIViewController that has a UIToolbar as the navigation bars right UIBarButtonItem. When in fullscreen as you can see on the top of the image, the toolbar displays correctly. However, when I present the same view controller modally (formSheet in this case) the toolbar doesn't display correctly.
The code I'm using for the bar...
I am using reverseGeocoder in a few places in my app. This particular instance, I am using it to update details about my annotation. I have created a property (MKPlacemark) which stores the new placemark each time the didFindPlacemark method runs.
The problem is, it always seems to be behind by one update. Meaning, when my custom met...
Right now I have this-
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (event.type == UIEventSubtypeMotionShake) {
int text = rand() % 12;
switch (text) {
case 0:
textview.text = @"blah." ;
break;
For some reason, the text has to be selected for it to work. If you just shake it, nothing wi...
([UIDevice currentDevice].orientation);
using the above code in my app, all i get is 0 (unknown)
is there something thats going wrong here? Seems pretty straightforward
edit: more research led me to the problem with using device orientation early in the app, which I am doing. However when I instead use interfaceOrientation, it always...
I just add gcal to my project according to this tutorial http://www.youtube.com/watch?v=it_9H0GxRNI
but 12 errors is appeared:
"_SecItemAdd", referenced from:
-[GDataOAuthKeychain setPassword:forService:account:error:] in GDataOAuthViewControllerTouch.o
"_kSecMatchLimit", referenced from:
_kSecMatchLimit$non_la...
Hi,
I am working on an application and would like to apply some syntax highlighting to some user entered text. I have looked around and some people are suggesting that this can be done in OS 3.2+ but posts seem to be from before the NDA was lifted. Does anyone have any suggestions as to how to go about doing this?
I would be interested...
I would like to replicate the notification sort of system provided with CoreData NSFetchedResultController which with really little enables us to update a tableView based on events such as Insert/Update/Delete of objects represented as Cells.
I'm currently using SQLitePersistentObjects as a Database abstraction layer: http://code.googl...
Hey all,
i know this is probably not an easy question to answer, as it's hard to describe on my hand.
I have an app that runs without problems on the device in Debug Configuration (also multiple times).
Once I put it into Release Configuration (which I need before publishing?), the app starts without problems and I can proceed to the n...
I need help on how to find out how many days it has been (seven day weeks, MSTimezone) since May 6th, 2009
[NSDate *m62009 = [NSDate dateWithTimeIntervalSinceReferenceDate:231638400];
[m62009 setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"MST"]; (to help you - 231638400 seconds from 1/1/2001)
Edit:
And then how can I convert the ...
Hi everyone,
I'm trying to build a 4 player multiplayer game using GameKit. I tried many things and I'm currently using client/server mode, meaning that I have 1 session in GKSessionModeServer and 3 other sessions connecting to this one in GKSessionModeClient. My goal is, that when a user leaves the game or gets disconnected for whateve...
I am using an NSTimer which I have working to show minutes and seconds. But I am confused about the math needed to calculate hours.
I am using:
- (void)updateCounter:(NSTimer *)theTimer {
static int count = 0;
count += 1;
int seconds = count % 60;
int minutes = (count - seconds) / 60;
// Not sure how to calculate h...