Discussion Forums  >  iOS / Android Beta Testers

Replies: 16    Views: 118

devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
12/29/12 03:43 AM (11 years ago)

Errors in xcode BT_fileManager.m for apple app

We are working on a second submission of an app that has already been compiled and successfully sent to Apple once. When the source code is opened up – with no changes from previous version that processed through the same xcode program just 2 weeks ago – the following errors are showing up in the code. BOOL ret = FALSE; if(fileName != nil && [fileName length] > 1){ NSFileManager *fileManager = [NSFileManager defaultManager]; BOOL success = [fileManager fileExistsAtPath:[self getFilePath:fileName]]; if(success){ //get URL to this file.... NSURL *fileURL = [NSURL fileURLWithPath:[self getFilePath:fileName]]; const char* filePath = [[fileURL path] fileSystemRepresentation]; const char* attrName = "com.apple.MobileBackup"; if (&NSURLIsExcludedFromBackupKey == nil) { // iOS 5.0.1 and lower u_int8_t attrValue = 1; ret = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0); ret = TRUE; //[BT_debugger showIt:self:[NSString stringWithFormat:@"markFileAsDoNotBackup: SUCCESS: %i", result]]; } else { // get rid of extended attribute if it exists already... int result = getxattr(filePath, attrName, NULL, sizeof(u_int8_t), 0, 0); if (result != -1) { int removeResult = removexattr(filePath, attrName, 0); if (removeResult == 0) { NSLog(@"Removed extended attribute on file %@", fileURL); } } NSError *error = nil; BOOL success = [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:nil]; Any idea in simple terms how to fix these problems? Thank you.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/29/12 11:57 AM (11 years ago)
Hi msta, I would re-download the source code if possible. I know there were some recent changes to the BT_fileManager.m code to help with Apple guidelines. Keep us posted:) ian
 
devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
like
12/29/12 01:50 PM (11 years ago)
Thanks, Ian. That has been tried and still no luck. The source code was downloaded and cleared three times yesterday. Also, for a little more context, we checked for xcode program updates and computer system updates and everything is as up-to-date as possible (working on a Mac with xCode version 4.2 - that is the "highest" version supported on this computer). Any other ideas?
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
01/01/13 02:35 PM (11 years ago)
Did you resolve this? I'm having the same problem. Everything worked fine until yesterday when I downloaded latest source code and tried to build. I'm also on version 4.2. if (&NSURLIsExcludedFromBackupKey == nil) { Use of undeclared identifier 'NSURLIsExcludedFromBackupKey'
 
devapps123
Apple Fan
Profile
Posts: 50
Reg: Jul 12, 2012
Sarasota, FL
500
like
01/01/13 04:39 PM (11 years ago)
Hi shenry. Still no luck here. I'll post the answer once it's figured out.
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
01/01/13 05:31 PM (11 years ago)
Well, I downloaded the data source several times and it continued to show the error. But I just downloaded it again, and it was able to build with no errors. I didn't change anything. It's a mystery.
 
JackAtZeezicht
Aspiring developer
Profile
Posts: 1
Reg: Dec 05, 2012
Amsterdam
2,160
like
01/09/13 06:32 AM (11 years ago)
For me, no... I still have troubles with this.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/09/13 06:17 PM (11 years ago)
Hi Guys, Looking into this further for you. Xcode 4.5 would fix this and allow you to build IOS 6 apps Check out The BT Webinars, very helpful!! Keep you posted:) ian
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/09/13 07:45 PM (11 years ago)
Replace this method in BT_fileManager.m...see if the compiler still yells! //addSkipBackupAttributeToItemAtURL... +(BOOL)markFileAsDoNotBackup:(NSString *)fileName{ return TRUE; } This will cause some other gotcha's I'll address in a bit. The fact is, your machines are not able to compile using latest iOS SDK and this will cause other trouble.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/09/13 10:15 PM (11 years ago)
Thanks David! Thanks as well for taking the time to discuss this forum topic in the Webinar. Look for the 1/9/13 Webinar recording soon:) ian
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/10/13 11:59 AM (11 years ago)
Hey guys, Check out this Webinar post. David talks about your specific problem. https://www.buzztouch.com/forum/thread.php?fid=2F78095D6348607B167D074&tid=2F78095D6348607B167D074
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/10/13 02:27 PM (11 years ago)
Hi Guys, If anyone else is experiencing the same problem and after the code change suggested by David the simulator won't start (completely) do this: go to 'Targets' --> 'summary' --> scroll down until you see the list of all the frameworks --> set the twitter.framework to optional That's it and the app will run..... Best Regards, Danny
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/10/13 02:35 PM (11 years ago)
Great Danny thanks!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/10/13 02:57 PM (11 years ago)
Good blog post about the document / cache / iCloud issues here. Says it better than I ever could :-) http://vuknikolic.wordpress.com/2012/07/23/ios-fragmentation-icloud-style/
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/10/13 03:01 PM (11 years ago)
Yep, They don't make it easy for developers.... Best Regards, Danny
 
BrunoSa
Lost but trying
Profile
Posts: 10
Reg: Jan 21, 2013
Los Angeles
2,800
like
01/22/13 06:01 PM (11 years ago)
Hello everyone! I am having this problem in my project. It might be because I am using Xcode 4.2 running on Mac 1.6.8 Snow Leopard? Hi @PSMDanny, I did what you said about the framework but it didn't work.. Hi @David, I tried to change my BT_file using some of those instructions from that blog, I've got more errors and so I had to replace the file for the original one. If you guys have some additional hints I'll be more than happy to try... This is my second day in this community which seems to be more like a family with good people! Anyways guys thanks so much! Bruno.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/23/13 05:24 PM (11 years ago)
Gosh darn it, you may have to upgrade to a more modern Mac or upgrade the current Mac to run Lion or Mt. Lion such that the current version of Xcode can be used. -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.