Tag: objective c

How to deal with background image orientation in UIView

I’m using setting the background image using methodology below. When I rotate my device the background repeats, which make sense because it is not an image. How do I deal with orientation change if this is the way I’m setting my background image? – (void)viewDidLoad { [super viewDidLoad]; UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@”background.png”]]; […]

animations on infinite loop

I have 5 different animations that animate then disappear one after another. Is there a way to put them on an infinite loop so animation #1 begins and ends, then anim #2 begins and ends etc..? the whole process then would repeat on an infinite loop. I have the animations in separate blocks on delays. […]

iOS Touch, Gestures, Animation

I am exploring iOS4.3 SDK & wanted to implement a particular animation effect. But have no idea how to do it. It goes like this – I have a square box on the screen & upon user putting his finger on the box & dragging his finger the box should follow him. It’s easy till […]

Exception : unrecognized selector when i click on calloutAccessoryControlTapped

i have a problem with that exception, actually, when i click on the calloutAccessoryControlTapped button of the pin i got this exception, i try to track the error by the NSLog in the console and i found the only pin which caused this exception have the value <null>, i explain by some code : for […]

CoreMIDI: rock solid midi sync

I’m having troubles with midi synchronization. Following posts in the syntheticbits.com, I use a PGMidi class. Sync works, but is constantly shifting to 1-2 bpm. Here is the code that I use: – (void)sendMidiClockInMidiThread { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [lock lock]; const int64_t kOneMillion = 1000 * 1000; const UInt8 tick[] = { […]

Improve performance of drawRect:

I am drawing cells from a grid with a NSTimer every 0.1 Seconds. The size is about 96×64 => 6144 cells / images. If i am drawing images instead of (e.g.) green rectangles it is 4 times slower ! – (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); UIGraphicsPushContext(context); CGContextSetRGBFillColor(context, 0, 0, 0, 1); CGContextFillRect(context, CGRectMake(0, 0, […]

Custom Keyboard Set Cursor Position

I have a text field tapping on which a custom keyboard appears containing numbers 0-9 and a backspace button. I’m able to delete text at the end as well as from middle of string. But when i delete text from somewhere middle, the cursor jumps to end position. I want cursor to remain at same […]

Can width/height of a powerpoint presentation be calculated on iPad

I have an ipad app, which displays a powerpoint presentation from an NSData, within a UIWebView, and I need to know the width/height of a single slide so I know how far to scroll when advancing to the next slide. In PDF, I can calculate it using CGPDFDocumentRef, as below, but I can’t find a […]

how to convert php return NSData into NSDictionary

HI, i am creating an login screen to my iphone application. i am sending the username and password to php using NSURLConnection method. i can successfully send login details to php. My php page returning status values based on the login details. (status =OK / Fail , redirectionUrl=http://www.balalaa.com) In DidReceiveData method if i convert the […]

how to partial download a file from google drive use objective c?

I wanna download a big file from google drive use objective,and I use the google-api-objectivec-client-read-only lib.But when I download the big file,I see the memory boom up. For example,the file’s size is 589M,the program’s memory more than 600M.So I wannna partial download the file from google drive. My code: -(void)getFileMetadataWithService:(NSString *)fileId { GTLQuery *query = […]