iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

How to declare a two dimensional array of string type in Objective-C?

How do I declare a two dimensional array of string type in Objective-C?

UIImage from CALayer – iPhone SDK

In my application, I have created a CALayer (with a few sublayers – the CALayer is composed of shapes added as sublayers). I am trying to create a UIImage that I will be able to upload to a server (I have the code for this). However, I can’t figure out how to add the CALayer […]

Calculating Connection/Download Speed

I have a client and server program (both in Obj-C) and I am transferring files between two devices using the programs. The transferring is working fine, but I would like to display to the user what transfer rate they are getting. So I know the total size of the file, and how much of the […]

NSString is integer?

How to check if the content of a NSString is an integer value? Is there any readily available way? There got to be some better way then doing something like this: – (BOOL)isInteger:(NSString *)toCheck { if([toCheck intValue] != 0) { return true; } else if([toCheck isEqualToString:@”0″]) { return true; } else { return false; } […]

Sound not working in iPhone Simulator?

Somehow my iPhone Simulator is unable to play sounds. First an app I’m working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other iPhone apps such as the sample Crash […]

Suspending GCD query problem

i have trouble suspending a gcd query. Here is some code that demonstrates the problem: static dispatch_queue_t q=nil; static void test(int a){ if(q){ dispatch_suspend(q); dispatch_release(q); q=nil; } q=dispatch_get_global_queue(0,0); dispatch_async(q,^ { while(1){NSLog(@”query %d”,a);sleep(2);} }); } int main(int argc, const char* argv[]){ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; test(1); //blah blah blah test(2); while(1){} [pool release]; return […]

ObjC/Cocoa class for converting size to human-readable string?

Is there a simple way to do something like.. [NSMagicDataConverter humanStringWithBytes:20000000] ..which would return “19.1MB”?

Is there any way to enforce typing on NSArray, NSMutableArray, etc.?

Can I make an NSMutableArray where all the elements are of type SomeClass?

Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?

I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don’t know the exact duration and animation type of the keyboard, so it’s really bumpy. Here’s what I have: [theTextView resignFirstResponder]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:0.25]; […]

What is the BOOL *stop argument for enumerateObjectsUsingBlock: used for?

I’ve been using enumerateObjectsUsingBlock: a lot lately for my fast-enumeration needs, and I’m having a hard time understanding the usage of BOOL *stop in the enumeration block. The NSArray class reference states stop: A reference to a Boolean value. The block can set the value to YES to stop further processing of the array. The […]