codingtofu-blog
codingtofu-blog
CodingTofu
71 posts
Generic Code snippets and guides that were useful to me. Hopefully they will be useful to you.
Don't wanna be here? Send us removal request.
codingtofu-blog · 10 years ago
Text
PUSH NOTIFICATION IOS FROM APP CLOSED STATE(SWIFT)
Tumblr media
If you are coming from a objective c world or you never have done this EVER as an iOS developer. This snippet might shine some light to handling a remote notification when an application has come from a closed state. Easy peasy in objective C by swift as always is a different story.
YES A CLOSED STATE
if let remoteNotification = launchOptions?[UIApplicationLaunchOptionsRemoteNotificationKey] as? NSDictionary {      self.application(application, didReceiveRemoteNotification: remoteNotification as [NSObject : AnyObject])     }
Shove this at the end of “didFinishLaunchingWithOptions”. If your app has received a notification and the user is navigating from the springboard to a inactive app. This will pass on the handler and notification payload to your regular didRecieveRemoteNotifcation. From there you can just handle the notification as you always do. 
0 notes
codingtofu-blog · 10 years ago
Text
GENYMOTION ANDROID FIX
sudo cp /usr/local/bin/VBoxManage /usr/bin/VBoxManage
Quick fix for anyone having issues with virutal box not loading for their Genymotion. 
I ran 2.5.0 the other day and it worked fine on my home machine but the work one didn’t like it. Some stacking lead me to this, appears that the path is not correct.
I am using Virtual box 4.3 not 5
Enjoy
0 notes
codingtofu-blog · 10 years ago
Photo
Tumblr media
NSKEYARCHIVER , NSKEYUNARCHIVER, NSWHATEVER
So you have some custom objects in a array or whatever. You wanna save them to the app? PERSISTENT DATA as many of the hip kids are calling it these days. Whatever you call it outside a interview environment. Its a powerful and bloody useful thing. 
For this recipe you need two things
NSCODING
NSKEYARCHIVER. NSKEYUNARCHIVER\
NSCoding implemented in your Object
class Object: NSObject, NSCoding
Use and implement NSCoding on you object
required init(coder aDecoder: NSCoder) { self.intValue = aDecoder.decodeIntegerForKey("intValue") as Int if let name = aDecoder.decodeObjectForKey("name") as? String { self.name = name } }
Just like initWithCoder, the swift version. Set your vars here. This will be called when you are unarchiving your data back into this object
func encodeWithCoder(aCoder: NSCoder) { if let intValue = self.intValue { aCoder.encodeInteger(reps, forKey: "intValue") } if let name = self.name { aCoder.encodeObject(name, forKey: "name") } }
Set encoding values here, What Archiver uses to convert your object into a archived Object.
NSKEYARCHIVER. NSKEYUNARCHIVER Archive data
let data = NSKeyedArchiver.archivedDataWithRootObject(self.stuff!) let documents = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! String let filename = documents.stringByAppendingPathComponent("file") NSKeyedArchiver.archiveRootObject(data, toFile: filename)
So to explain the following, we are creating a NSData object from a collection of custom objects (i.e a array). Then we are creating a file path and archiving the data to this path.
To load files its pretty much the same process but inversed
let documents = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! String let filename = documents.stringByAppendingPathComponent("file") if let data = NSKeyedUnarchiver.unarchiveObjectWithFile(filename) as? NSData { if let array = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? NSMutableArray { // do something with the array } }
Here we are creating the file path, using unarchiver we are then retriving the NSData object. Now we are unarchiving the NSData obejct into the original collection of objects. (i.e the array of objects)
0 notes
codingtofu-blog · 10 years ago
Photo
Tumblr media
Wanna get some data from a plist and parse the crap out of it? Thought it was a breeze to loop a NSArray and just creator objects at the will of your slender thumbs? Well think again cause its swift and swift doesn’t care about how you used to do this.
Retrieve NSArray from plist
let path = NSBundle.mainBundle().pathForResource(plistName, ofType: "plist")let plistArray = NSArray(contentsOfFile: path!) as! [Dictionary<String, AnyObject>]
In this sample my array is a array of dictionaries in the plist. Thats why i am downcasting the returned array as a swift array of dictionaries. The dictionary returned back will be a dictionary of “anyobjects”. Remember this!!!!!
Loop through the dictionaries in Array
for dictionary in plistArray{
//do stuff here
}
This is pretty much the same as before, notice swift will automatically figure out the dictionarys are of type [Dictionary<String, AnyObject>].
Custom constructors
  convenience init(dictionary:Dictionary<String, AnyObject>)   {       self.init()       name = dictionary["name"] as? String   }
Now i’m only guessing at this point you have some sort of model object you want to contain all this amazing data. (also assuming you have some amazing data)
So in you object, just create a custom init as you would in obj-c land. Notice how i’m am setting the optional value of name with the “name” value in the dictionary.
Remember swift is all about the shrugs, If the name exists then set it, if it doesn’t ...shrug don’t set it!
0 notes
codingtofu-blog · 10 years ago
Text
Week of Swift
Tumblr media
Its been a quick week mining through various quick start guides and docs on the sea of internet tutorials. Coming from a primary objective c background and with the mentality of “The old ways are the best ways” haven’t been helpful. But in all honesty learning swift has actually been really fun. 
Things I like:
No Semi Colons
swift style methods
new style of instantiations
Things that make me go whoa:
Tuples
Dynamic type casting
functions in swift
Things that make me go boo:
no more @ - seriously i spend half my time backspacing on every string
xcode playground crashing all the TIME
Operationals - ok i get why you need them and how it works. But man shadowing is just a pain in the ass. 
Tumblr media
TUPLES!!!!!!!!!!
So imagine tuples as a magic basket. You can basically just shove anything into it. Perfect for times when you are receiving data back from a service, but you are only ever going to use the data once. Instead of painfully creating a model structure you could just use a tuple
var tuple = ("hello", 1,  testClass(), newDouble);
you can even name the values inside tuples for easy access
var tuple = (string1:"hello", string2:"goodbye")
grabbing values is quite easy too, just use dot notation and reference index you want to grab out of the tuple or name you have given the value.
0 notes
codingtofu-blog · 10 years ago
Photo
Tumblr media
Its a bummer to be late to the party. So after finally getting some free down time. I decided to finally join the bandwagon and do some seriously learning. 
Let the times of swift begin! Times of swift
0 notes
codingtofu-blog · 11 years ago
Text
SMoking VFL
Tumblr media
You know that scene from lord of the rings where bilbo is chillin with Gandalf ,blowing smoke rings. All of a sudden this guy just blows a friggin ship from out of nowhere, bilbo just hangs and stares. 
Thats the exact same feeling when looking at a friggin VFL sample from ANywhere. So battling with this for a while I decided to write a SUPER high level dummy guide to constraints.
So first things first, why is your app crashing when you adding crap loads of constraints to your view
The view your setting constraints to ain't got no parent.
Your naming convention or dictionary is wrong. VFL is a idiot so if you do know specify the dictionary well it crashes. we will get to this
Your constraints are soooo in conflict that you just killed xcode. 
Tumblr media
Remember  So-cratz - "The only true wisdom consists in knowing that you know nothing".
... thats US!!!!
Point 1
So point one, if you set constraints to something that has no superview it ain't going to work. When you think about it, it kind of makes sense. Xcode doesn't magically know what this UIlabel is going to be a child of a view. 
Also whenever you are even thinking about using a VFL for views. You have to implement this guy
setTranslatesAutoresizingMaskIntoConstraints
By defualt autoresizing masks on a view uses constraints to determine view's position. So if you are setting constraints on a view manually you have to set that to NO. Then you will have no conflicts with default constraints. 
Try not to use initWithFrame at all, replace that guy with new.
// no no no no UIView * newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; // yeah yeah yeah UIView * newViewAuto = [UIView new]; [newViewAuto setTranslatesAutoresizingMaskIntoConstraints:NO];
Warning bells might be ringing right now due to no frames being set. Remember that your view will autoresize according to intrinsic content size. Basically it will be as big as whatever you shove in it. Also you are going to set constraints to that view anyways when you add it to its superview. This in turn will set the size of the view.
So if your view had no set widths or heights, but your constraints set its edges to that of the superview. This will stretch the view to fullscreen. 
Point 2
Ok one of the stupidly annoying things about VFL is that its kinda dumb. You are essentially passing it a string with the names of your UIElements. In this string you are telling it padding values, width and height values and whether its aligned vertical or horizontal. THATS IT
So if you see
V|[backgroundBox]|
V is for vertical
Tumblr media
If you want to align things up and Down Use a V 
| This means superview
[outletname] You declare references to outlets by shoving them in brackets
So 
V|[backgroundBox]|
Means that a background box is going to be set to edges of superview VERTICALLY, not horizontally. 
Tumblr media
OK so you got vertical down, now you want to mess with widths. To do that Use H
H|[backgroundBox]|
So this guy is basically setting the backgroundBox to the edges of the superview's horizontal components
So if you combined the two
H|[backgroundBox]|
V|[backgroundBox]|
That will stretch the background box to the edges of the view, so full screen. Notice here that we did not set the frame values EVER.
Point 3
Ok so point 2 was the basics but pretty useless in real life development. Lets try to use a nicer example, one that you will actually benefit from.
We are doing to make a traffic light
Tumblr media
In autolayout it looks like this
UIView * newViewAuto1 = [UIView new]; [newViewAuto1 setBackgroundColor:[UIColor redColor]]; [newViewAuto1 setTranslatesAutoresizingMaskIntoConstraints:NO]; UIView * newViewAuto2 = [UIView new]; [newViewAuto2 setBackgroundColor:[UIColor yellowColor]]; [newViewAuto2 setTranslatesAutoresizingMaskIntoConstraints:NO]; UIView * newViewAuto3 = [UIView new]; [newViewAuto3 setBackgroundColor:[UIColor greenColor]]; [newViewAuto3 setTranslatesAutoresizingMaskIntoConstraints:NO]; [self.view addSubview:newViewAuto1]; [self.view addSubview:newViewAuto2]; [self.view addSubview:newViewAuto3]; NSDictionary * bindings = NSDictionaryOfVariableBindings(newViewAuto1, newViewAuto2,newViewAuto3); [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[newViewAuto1]|" options:0 metrics:nil views:bindings]]; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[newViewAuto2]|" options:0 metrics:nil views:bindings]]; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[newViewAuto3]|" options:0 metrics:nil views:bindings]]; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[newViewAuto1][newViewAuto2(==newViewAuto1)][newViewAuto3(==newViewAuto1)]|" options:0 metrics:nil views:bindings]];
So what are we doing, well first off we create the three views and set the colours. 
Next we need to create a dictionary which VFL can reference the views. The guys at apple make a nice helper method that does this for us.(although you can also just create a nsdictionary manually and set the key/values yourself)
NSDictionary * bindings = NSDictionaryOfVariableBindings(newViewAuto1, newViewAuto2,newViewAuto3);
This method will make a dictionary with the value name and key set to the name of the outlet. 
So "newViewAuto1"= <newViewAuto1 obj>
This is how VFL references the outlet, So in this line
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[newViewAuto1]|"
We are setting the horizontal leading and trailing of newViewAuto to be pinned to the same of the superview. Not that the string references "newViewAuto1", which obviously will be referred in the dictionary. If you get the naming wrong in VFL it will crash so make sure you get the names you reference correct. 
Tumblr media
Now lets do the vertical alignment to get them all in a nice row format.
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[newViewAuto1][newViewAuto2(==newViewAuto1)][newViewAuto3(==newViewAuto1)]|" options:0 metrics:nil views:bindings]];
So this is what is going on
Using V so we are aligning everything vertically
We are putting the views next to each other with no padding values. So they will naturally be positioned right next to each other. 
Finally inside the [] brackets we setting a equals constraint. By setting (==newViewAuto1) because its in a vertical constraint, this will basically set the height of the view to be equal the other view. So [newViewAuto2(==newViewAuto1)]. Means newViewAuto2's height will be the same as newViewAuto1's. This is set to newViewAuto3 aswell. This is how we have equal height distribution. 
You can also use other relations such as == ,<= ,>=.
Point 3
Set up constraints slowly and one at a time, try not setting constraints everywhere at once cause it will be a pain to debug. 
Also because you do not have to specify view sizes now because of intrinsic content size. It is good practice to added and set constraints into containers. Then position the container in relation to the whole superview. So in 1 case say you have 4 labels with padding aligned. You can just added them to a container view then position that view central to the super. This will in turn position all the views. 
Hope this helps
1 note · View note
codingtofu-blog · 11 years ago
Photo
Tumblr media
Using storyboards everywhere with Friggin Autolayout?
Trying to use nsnotifications but dont want to add obsever in the did load method. 
Then shove it all in 
- (id)initWithCoder:(NSCoder*)aDecoder { if(self = [super initWithCoder:aDecoder]) { } return self; }
Then remove obsever inside the dealloc
-(void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; }
0 notes
codingtofu-blog · 11 years ago
Link
Get RoboRobo on the App Store. See screenshots and ratings, and read customer reviews.
Hey guys I have recently released a new spritekit game i knocked up in my spare time. Please have a look and try it out
0 notes
codingtofu-blog · 11 years ago
Text
Xcode Build Error Compile
Run Xcode project, warnings pop up...ok ERRORS POP UP OHHH NOO!!!!
Tumblr media
Turn your Xcode to rocky mode and plough through the errors. This way you can see how many errors you have in your project. It won't make your project magically run but it will be helpful to figure out what kinda Errors are appearing (instead of xcode pussying out at the first one). So after you crash down and fix those bugs you can scream...
Tumblr media
0 notes
codingtofu-blog · 11 years ago
Text
Xcode 6 Selected constraints for Adaptive Sizes
Tumblr media
Still here and still playing around with xcode 6 adaptive sizes. Yes some people may hate it but it is kinda handy..... if you are not doing crazy custom animations (and have a monitor the big enough). 
So in my previous tutorial i showed how you can adjust constraint values based on adaptive size values (ipad = bigger image, iphone = smaller). This isnt the only thing you can do, You also can disable UIElements and constraints for different size classes. 
In this example we are going to have a button visible on landscape but not available on portrait. (basic i know). 
Tumblr media
So here is our button...beautiful isn't she. 
So i have set the following constraints:
Vertical space 20
Horizontal space 20
Width: 219
Height: 58
So portrait and landscape look something like this
Tumblr media Tumblr media
Now in our case we want to disable the button completed from the view when we are in a landscape state. To do this first select Any Width, Compact Height. 
Tumblr media
This will set your storyboard into landscape mode(for iPhones). 
Next left click on the Button and press (CMD + Backspace)
Once you do this the button will be removed from the view, if you look at the view controller you can see the button has been shaded out. 
Tumblr media
Now when you go back to portrait mode(any width any height) the button will be visible again. But when you go to landscape it will be gone. 
Tumblr media
So you should get something like this. 
So to break it down again:
Select size class
Click on view/constraint
Cmd+ backspace to hide view/constraint
You can also remove all constraints for a specific view by simply click on this  (the tie fighter looking symbol :P)
Tumblr media
0 notes
codingtofu-blog · 11 years ago
Text
Xcode 6 Adaptive Layout
Tumblr media
After watching the adaptive layout WWDC video and looking at the code base of some of my apps. I thought it might be good to get some basic knowledge on adaptive layout (as there might be a fair few different screen sizes coming our way. )
So here we go, you will need :
xcode 6 (beta at this point)
some images to play around with (in my case i am going to use this)
So open up and start a new project as usual. Drag and drop a UIImage view inside your view. Set your imageview to use the image of your choice. 
Xcode 6 looks flatter and weirder, you now how a preview mode which shows you how your layout will look on a specified device. You also have size classes that you have to worry about.  One slightly annoying thing about using preview and storyboards is that if your monitor is quite small, things get very fiddly very fast. 
Tumblr media
To turn on preview mode just select it from the drop down 
Tumblr media
ADAPTIVE SIZE GRID (SIZE CLASS)
Tumblr media
This is the adaptive size grid, it is what you will use to set constraints values for different sizes. 
Each square represent a size type, and there are 9 different ones
The top row is compact height, the middle row is any height and the bottom row is regular height.
The left column is compact width, middle column is any width and the right side is regular width. (confused yes i know)
Compact width+ Compact Height = iPhone Landscape 
Compact width+ Any Height= iPhone Landscape , iPhone Portrait
Compact width+ Regular Height = iPhone portrait
Any width+ Compact Height = iPhone Landscape 
Any width+ Any Height = Everything
Any width + Regular Height= iPhone portrait, iPad Landscape, iPad Portrait
Regular Width + Compact Height = custom views apparently
Regular Width+ Any Height = iPad Landscape, iPad Portrait
Regular Width + Regular Height =  iPad Landscape, iPad Portrait
This system is basically a way for you to create relational structures between difference screen sizes. This is not only intended for when you use different devices but also when say a view resizes to a different size. By using these Size classes you are able to enable, add and disable constraints based on the size type. 
So lets say we have a iPad application and we have set the following constraints for our image:
20 px padding from top
20 px padding from right
height = 360
width = 298
Tumblr media
When we run this on iPad its fine however when we run it on iPhone things get a bit nippy. 
Tumblr media
As you can see the image is too big, we can fix this by using adaptive sizing and modifying the constraint. To do this select on the sizing grid and select Compact Width and Any Height. This will adjust your storyboard layout 
Tumblr media
Now adjust your image to the size you want, in my case i'm going to reduce it down to 200 by 200. Next you need to modify the height constraint, click on the constraint and look at its inspector. You should see something like this
Tumblr media
Click on the + symbol and select compact width, regular height. This will add a new constant field. Set this constant to be 200(or whatever you want the height to be), you also need to activate this constraint by adding it in the installed section. Click on the + symbol next to installed and do the same (select compact width and regular height). 
Tumblr media
So essentially what we have done is made the height equal to 200 when the sizing type is in iPhone portrait. All other cases the size will be 298. 
Repeat this process with width and run the app again. Now your image should be different sizes for iPad and iPhone. Run the app again and now we have different sizes for iPhone portrait. 
Tumblr media
0 notes
codingtofu-blog · 11 years ago
Text
ERROR 5 FACEBOOK IOS
Tumblr media
So some of you might already know this, some may not. Occasionally when using the Facebook SDK you might get a error code 5 flagged up by facebook. If you dig around on stack you will probably find 5 points explaining why this is happening:
You are trying to performs another request when the first request has not completed. 
Session isn't open
You are doing the same post over and over again.
Your app isnt authorized on your facebook user account.
In my case, my application would get this error 5 when voiceover was activated......
After some digging i figured out it was the FBSession code. 
To retrieve a session you would do 
[FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:audience allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if (error){ /// do error handling in here } }];
(as feelingweird from stack explained)
simply performing FBSession openWithActivesesssion..... will not update FBSession.activeSession to be the FBSession retrieved from the completion handler. 
So when FBRequestConnection calls FBSession it will fail as the session it is calling isnt active. To resolve this, simply add this one linner
[FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:audience allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if (!error){ [FBSession setActiveSession:session]; } }];
Run things again and everything should work.
p.s
Edge case the error is out of your control. I have experienced at times if the user has already given access to your facebook application and re authenticate. Sometimes for no reason you will get ERROR 5 AGAIN. Only work around is to delete the facebook app and re run your ios application. 
Moral of the store..... use SLCompose
0 notes
codingtofu-blog · 11 years ago
Text
Code Coverage
Tumblr media
Implementing TDD into our application is nice, but knowing that only the tests have passed or failed might not be detailed enough metrics for the higher ups. Especially if they are going crazy with metrics to shove in their clients faces. This is where code coverage comes in.
Code coverage tools give you the hard red and green stats to show peers or employers:
Testing is being done and everything feels safer for your boss and your boss's boss. 
Some thought has been put into the general architecture of the app. (if there wasn't your tests would be super hard to implement)
You are doing work and numbers are being generated on screen.
Interpreting code coverage values is also super important. trying to achieve a 90% coverage figure is crazy and will waste everybody's time. Also it will cause the creation of useless test. Quality over quantity is always key for testing. Tests should have meaning and be high quality. So your average figure should be totally dependent on how complex the app is.
Tumblr media
Anyway enough talk, lets get straight to the tools!!!!
TOOL 1 CoverStory
Tumblr media
LINK HERE
Yes it does have a picture of jobs on the front, Yes the website looks slightly dodge. But this tool is pretty damn handy, especially if you just want a quick reference as you are developing. Simply open you project directory in this application and BAM. You have a simple list of your classes and a coverage percentage for each class. Also you have a general project average.
Tumblr media
TOOL 2 XcodeCoverage by Jon Reid
Tumblr media
Github link here
Jon Reid the industry know and author of popular coding block quality coding. This library is awesome, after you run unit tests it will generate a nice HTML file to display your coverage figure. 
This is especially useful if you have a C.I environment and others are checking up on you. They can access this outputted webpage from the server's build directory. Slightly more heavy with implementation, requiring you to add some tiny additions to your project. But still it is super easy to implement. 
You can get the full walkthrough on quality coding, better yet Jon updated XcodeCoverage to be compatible with 5.1 a while ago. So you have nothing to fear until 6 GM is finished. 
The main tutorial is here
If you want to access the html file instead of going into the derived data found in the library application support folder. You can set your derived data path to be relative to workspace. To do this:
Go to xcode preferences
Tumblr media
Go to locations and set custom relative to workspace.
Tumblr media
You can then find the index.html file inside the build folder
Tumblr media
Enjoy
0 notes
codingtofu-blog · 11 years ago
Text
DYLIB Linkers
Ever seen this error randomly occur:
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/usr/lib/libSystem.B.dylib' for architecture i386
especially when you are working on a old project using the latest version of xcode. To resolve this issue, find the dylib linker settings in your project and remove references to dylib. 
Tumblr media
Remove -weak_library and the reference to your dylib.
Clean and compile again. Hopefully it should work. 
0 notes
codingtofu-blog · 11 years ago
Text
Object Copying
Tumblr media
So you have a custom object representing some kind of data structure and you want to copy one object's data to another pointer. For this example lets say we have product information stored in product model objects. Lets also say we have an array of these objects
NSArray * products = [NSArray alloc]initWithObjects:product1, product2, nil];
And lets say we create a new array which adds all these objects
NSMutableArray * products2 = [[NSMutableArray alloc] initWithArray:products];
If you edit the product objects in the product2 array. You will find that all the changes will be passed over to the original array. This is because the pointer of the object is being referenced in both arrays. 
So in essense products[0] is the same as products2[0]
If this behaviour is incorrect in your application and you wanted to clone the objects into new references you will have to implement NSCopying. 
Now apple provide two types of copying protocol, these is NSCopying and NSMutableCopy. 
They are quite similar, in general you should just implement NSCopying. However as apple states you should only use NSMutableCopying if "Only classes that define an “immutable vs. mutable” distinction should adopt this protocol"
So lets say you would use NSMutableCopy when transitioning between a immutable to mutable state.
i.e Copying NSArray into NSMutableArray
Anyway to implement NSCopying all you have to do is implement its protocol. 
#import <Foundation/Foundation.h> @interface CustomObject : NSObject<NSCopying> -(id)copyWithZone:(NSZone *)zone; @end
In your header file just implement the NSCopying
#import "CustomObject.h" @interface CustomObject() @property (nonatomic,strong) NSString * typeStr; @end @implementation CustomObject -(id)copyWithZone:(NSZone *)zone{ id copy = [[[self class] alloc] init]; if (copy) { [copy setTypeStr:self.typeStr]; } return copy; } @end
And in your main file just implement the copyWithZone method. Set any properties you want the copy to have from the original.
Thats all there is to it
0 notes
codingtofu-blog · 11 years ago
Text
profiling:invalid arc tag
Seeing invalid arc tags but your unit tests still running clean??
Just clear your derived data. 
Or better yet set your derived data to be relative to your workspace. 
Go to xcode->prefs->locations->advance
Tumblr media
Just delete the build folder and everything will be fine and dandy. 
0 notes