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

Is there a way to catch an WillRotateToInterfaceOrientation event from an UIView?

every UIViewController has a method called willRotateToInterface. Is it possible to do this within a UIView too? Does this match the idea of model view controller ? The only way I can think of is to send the event from the UIViewController to the UIView. Is there a global variable for the current orientation?

clip-masking uiview with CAShapeLayer and UIBezierPath

I have a problem clipping a view using CAShapeLayer-UIBezierPath , I want to clip the content but I end up getting a stroke (frame) with that UIBezierPath , This is my code UIBezierPath *path2Path = [UIBezierPath bezierPath]; [path2Path moveToPoint:CGPointMake(206.745, 0)]; [path2Path addLineToPoint:CGPointMake(206.745, 97.613)]; [path2Path addLineToPoint:CGPointMake(0, 97.613)]; [path2Path addLineToPoint:CGPointMake(0, 0)]; [path2Path addLineToPoint:CGPointMake(87.28, 0)]; [path2Path addCurveToPoint:CGPointMake(103.808, 12.118) […]

Stop and start an animation by touch. Objective C

I have made an animation that moves across the screen, my animation loops continuously. How can I stop the animation when you tap the animated image, Then let the animation continue when you lift the touch? I know how to use TouchesMoved to move a specified button like this: CGPoint point = [[[event allTouches] anyObject] […]

How can I reverse the byte order of an NSInteger or NSUInteger in objective-c

This is a somewhat of a follow up to this posting but with a different question so I felt I should ask in a separate thread. I am at the point where I have four consecutive bytes in memory that I have read in from a file. I’d like to store these as a bit […]

Blocks and retain cycles

One minor question: why is Xcode complaining that listing 1 would lead to a retain cycle, while in listing 2 it does not? In both cases _clients is an int instance variable. In listing 2 it is assigned 0 in the init method. Background info: I would like to execute the loop in the block, […]

Game Center Matchmaking GKTurnBasedMatch has significant lag (~1 min)

I’m implementing a turn-based game with multiplayer mode through gamecenter. I have 2 devices (1 ipad, 1 iphone) to test in sandbox mode which were working fine but lately it has started to struggle in auto matchmaking process. After I send the first turn from one user, the other device doesn’t immediately recognize that game […]

NSJSONSerialization and Unicode, won't play nicely together

I’m in the making of an app that talks to a nodejs-server using sockets and JSON, and since iOS 5 has it’s own NSJSONSerialization I thought that’s may be the road to follow. Before, I used the lightweight yail library. Anyway, after the migration to NSJSONSerialization I started to encounter problem with the encoding, before […]

How to show uidatepicker from uitableviewcell

How can I show a UIDatePicker from UITableViewCell, and have the datepicker have a toolbar at the top that lefts you resign it? Are there any good tutorials on how to do this?

Enterprise application download cannot connect to “website address” error

I have created an AD Hoc enterprise build. I used the following Save for enterprise or AD Hoc Deployment Choose my distribution cert Save as “MyAppName” Select “Save for Enterprise Development” Application URL “https://www.myurl.com/app/ Title “MyAppName” After which I upload the build to my website I have created a index.html page that looks like this. […]

iOS devices return different format device model, why?

I use this method to fetch device model name: + (NSString *) machineModel { const char *name = “hw.model”; #if TARGET_OS_IPHONE // .model on iOS returns internal model name (e.g. “N51AP”) when we’d prefer to see the model identifier here (“iPhone6,1”) name = “hw.machine”; #endif int error = 0; size_t length = 0; error = […]