Tag: xcode

What unit is used by the Scene Editor in Xcode?

The Scene Editor in Xcode displays sizes but no unit. Is it a size in inches or a size in meters? For instance, when I select a node, e.g. a box, when I inspect its properties in the Node Inspector and I check its size in the “Transforms” section next to “Bounding Box”, no unit […]

Change background color with a variable iOS

I want to change the background color of my label with a variable how can I do that ? This is my code but I’d like to have a variable instead of ‘redColor’ [publisherLabel setBackgroundColor:[UIColor redColor]];

How add a UIButton on every image of image view which is in scroll view?

i have an iPhone app in which i have several images. These images add in image view. That image view add sub view with scroll view. Now i want to add a transparent button on every image. How can i do that? I have shown my code below: – (void)layoutScrollImages{ UIImageView *view = nil; NSArray […]

SQLITE Database Error 14

I’m developing a game where there are 4 buildings and in these buildings, there are 3 stages inside. The player can play the stages one by one, from one building to another, however, when they have finished one cycle (eg. going from building 1 stage 1 to building 4 stage 3) I keep getting this […]

Setting constraints to UIScrollView

Need some help to set constraints to UIScrollView. I tried to follow the instructions here: https://developer.apple.com/library/ios/technotes/tn2154/_index.html (Mixed approach). Setting 4 sided constraints to UIScrollView. Then set 4 sided constraints to the buttonContainer. This the result: However xcode is giving this error message: If I try xcode’s recommendation, either the scrollview will not scroll, or it […]

Access UITableView cell and swipe between them from DetailView using XCode 4

I’m making my first app and I’m using XCode 4 with a Storyboard. Thanks to this place, lots of tutorials, Apple’s archives databases and a bit of me, I’m slowly getting the basics together. It’s an app populated from a plist. The plist is an array with dictionaries, the dictionarires containing stings with info about […]

NSURL errors with caret ^ in string

Attempting to get data on the S&P500 (symbol: ^GSPC) from Yahoo Finance. In playgrounds and scripts, the presence of a caret (^) in the string passed to NSURL errors with “Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_1386_INVOP, sub code=0x0)”. Xcode 6b6 and b7. Works fine with other ticker symbols (AAPL, MSFT, etc). Any suggestions for how […]

1st ViewController in Portrait and SecondViewController in Landscape Mode

My requirement is this my 1st viewcontroller open in Portrait mode only.and when user goes to 2nd viewcontroller i want that controller in Landscape mode how may i do this i tried this code 1st ViewController.m – (BOOL)shouldAutorotate { returnc YES; } -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskPortrait; } -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface { return (interface==UIInterfaceOrientationMaskPortrait); } […]

Sending “NSString *_strong*to parameter of type _unsafe_unretained id* ”change retain/release properties of pointer

Im getting the following error Sending “NSString *_strong*to parameter of type _unsafe_unretained id* “changes retain/release properties of pointer … in the following line: [theDict getObjects:values andKeys:keys]; Im trying to add an address from contacts to my app. Could someone explain to me what its complaining about? I think its an ARC issue, possibly to do […]

Align text fields using dynamic constraints

I’ve been learning how to make iOS apps, and have come across a minor annoyance. I can’t find an easy way to align my text inputs. Looking at the below screenshot, you will see that I’ve managed to align my text fields, which is what I want. However, I did this manually by changing the […]