2012-01-31 123 views
3

iTunes拒絕我的應用程序,因此我必須對其進行修改。我做了它,現在我無法啓動模擬器上的應用:構建失敗:未找到符號

Ld /Users/user/Library/Developer/Xcode/DerivedData/emars-hgjxnbewvbrekiepjbfkvodcrvtk/Build/Products/Debug-iphonesimulator/emars.app/emars normal i386 
    cd "/Users/user/TRAVAIL/MMW/iphone application V1.0/e-mars" 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/emars-hgjxnbewvbrekiepjbfkvodcrvtk/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/emars-hgjxnbewvbrekiepjbfkvodcrvtk/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/emars-hgjxnbewvbrekiepjbfkvodcrvtk/Build/Intermediates/emars.build/Debug-iphonesimulator/emars.build/Objects-normal/i386/emars.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Objc -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework SystemConfiguration -lz.1.1.3 -o /Users/user/Library/Developer/Xcode/DerivedData/emars-hgjxnbewvbrekiepjbfkvodcrvtk/Build/Products/Debug-iphonesimulator/emars.app/emars 

這裏是結尾:

Undefined symbols for architecture i386: 
    "_OBJC_IVAR_$_UIViewController._title", referenced from: 
     -[FirstViewController viewDidLoad] in FirstViewController.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

也許它要求我不包含一個庫(我停處理有關,因爲很多庫)...

編輯:該錯誤是由新的代碼來我已經改變,因爲如果在商店應用程序的拒絕

這是我的代碼(運行,但通過ItunesConnect拒絕)

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Login et mot de passe" message:@"" delegate:self cancelButtonTitle:@"Annuler" otherButtonTitles:@"Sauvegarder", nil]; 
     [alertView addTextFieldWithValue:@"" label:@"Login"]; 
     [alertView addTextFieldWithValue:@"" label:@"Mot de passe"]; 
     // Username 
     textfieldName = [alertView textFieldAtIndex:0]; 
     textfieldName.keyboardType = UIKeyboardTypeAlphabet; 
     textfieldName.keyboardAppearance = UIKeyboardAppearanceAlert; 
     textfieldName.autocorrectionType = UITextAutocorrectionTypeNo; 
     // Password 
     textfieldPassword = [alertView textFieldAtIndex:1]; 
     textfieldPassword.clearButtonMode = UITextFieldViewModeWhileEditing; 
     textfieldPassword.keyboardType = UIKeyboardTypeNumbersAndPunctuation; 
     textfieldPassword.keyboardAppearance = UIKeyboardAppearanceAlert; 
     textfieldPassword.autocorrectionType = UITextAutocorrectionTypeNo; 
     textfieldPassword.secureTextEntry = YES; 
     [alertView show]; 

這是代碼,收到此錯誤:

// Ask for Username and password. 
     UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:_title message:@"\n \n \n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; 

     // Adds a username Field 
     textfieldName = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; 
     textfieldName.placeholder = @"Login"; 
     [textfieldName setBackgroundColor:[UIColor whiteColor]]; 
     textfieldName.enablesReturnKeyAutomatically = YES; 
     [textfieldName setReturnKeyType:UIReturnKeyDone]; 
     [textfieldName setDelegate:self]; 
     [alertView addSubview:textfieldName]; 


     Show alert on screen. 
     [alertView show]; 
     [alertView release]; 

感謝您的幫助我!

+0

蘋果爲什麼拒絕你的應用程序?你爲什麼要訪問'UIViewController'的'._title'屬性?這可能是一個私人/不支持的事情。最好放置(並訪問)你的'title'屬性到你的子類視圖控制器中。 – 2012-01-31 10:17:27

+0

@邁克爾:感謝您的快速詢問。因爲「我們在你的應用程序中發現了以下非公開API/s:addTextFieldWithValue:label:」兒子我正在嘗試該代碼:http://stackoverflow.com/questions/3784134/any-non-private-api-alternative -for-this – clement 2012-01-31 10:18:44

+0

@Michael:如果我評論了我編輯的代碼,應用程序就會生成,因此我編輯了我的第一篇文章;-) – clement 2012-01-31 10:25:40

回答

5

_title不是有效的伊娃使用。它在UIViewController中定義,這就是爲什麼你沒有得到未定義的錯誤,但它被聲明爲@package這意味着它是內部的。總之,不要使用_title

+0

如果您嘗試使用'_view' – aledalgrande 2014-05-25 00:10:20

相關問題