2010-02-21 4 views
0

내가보기 [self.view addSubview:RootViewController.view]를 추가하는 코드를 가지고 있으며 여기에 나에게 오류 error: accessing unknown 'view' class methodUIView의 addSubview : 방법 오류 문제

을 제공합니다 도움이 될 것 잔뜩 더 많은 물건입니다.

CompileC build/iTracker.build/Debug-iphoneos/iTracker.build/Objects-normal/armv6/NewLogViewController.o Classes/NewLogViewController.m normal armv6 objective-c com.apple.compilers.gcc.4_2 
cd /Users/markszymanski/Desktop/Programming/iTracker 
setenv LANG en_US.US-ASCII 
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x objective-c -arch armv6 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=3.1.3 -iquote /Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/iTracker-generated-files.hmap -I/Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/iTracker-own-target-headers.hmap -I/Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/iTracker-all-target-headers.hmap -iquote /Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/iTracker-project-headers.hmap -F/Users/markszymanski/Desktop/Programming/iTracker/build/Debug-iphoneos -I/Users/markszymanski/Desktop/Programming/iTracker/build/Debug-iphoneos/include -I/Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/DerivedSources/armv6 -I/Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/DerivedSources -include /var/folders/lv/lv+C4SRgFKyKVw+w5z1F-++++TM/-Caches-/com.apple.Xcode.502/SharedPrecompiledHeaders/iTracker_Prefix-faiusrzfiirznderkbprgchdlcni/iTracker_Prefix.pch -c /Users/markszymanski/Desktop/Programming/iTracker/Classes/NewLogViewController.m -o /Users/markszymanski/Desktop/Programming/iTracker/build/iTracker.build/Debug-iphoneos/iTracker.build/Objects-normal/armv6/NewLogViewController.o 

/Users/markszymanski/Desktop/Programming/iTracker/Classes/NewLogViewController.m: In function '-[NewLogViewController addLog]': 
/Users/markszymanski/Desktop/Programming/iTracker/Classes/NewLogViewController.m:22: warning: passing argument 1 of 'addSubview:' makes pointer from integer without a cast 
/Users/markszymanski/Desktop/Programming/iTracker/Classes/NewLogViewController.m:22: error: accessing unknown 'view' class method 
{standard input}:515:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_11" minus "L50" 
{standard input}:515:symbol: "L_OBJC_SELECTOR_REFERENCES_11" can't be undefined in a subtraction expression 
{standard input}:514:non-relocatable subtraction expression, "L_OBJC_CLASSLIST_SUP_REFS_$_0" minus "L49" 
{standard input}:514:symbol: "L_OBJC_CLASSLIST_SUP_REFS_$_0" can't be undefined in a subtraction expression 
{standard input}:469:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_9" minus "L44" 
{standard input}:469:symbol: "L_OBJC_SELECTOR_REFERENCES_9" can't be undefined in a subtraction expression 
{standard input}:468:non-relocatable subtraction expression, "L_OBJC_CLASSLIST_REFERENCES_$_2" minus "L43" 
{standard input}:468:symbol: "L_OBJC_CLASSLIST_REFERENCES_$_2" can't be undefined in a subtraction expression 
{standard input}:467:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_10" minus "L42" 
{standard input}:467:symbol: "L_OBJC_SELECTOR_REFERENCES_10" can't be undefined in a subtraction expression 
{standard input}:351:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_8" minus "L31" 
{standard input}:351:symbol: "L_OBJC_SELECTOR_REFERENCES_8" can't be undefined in a subtraction expression 
{standard input}:349:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_7" minus "L29" 
{standard input}:349:symbol: "L_OBJC_SELECTOR_REFERENCES_7" can't be undefined in a subtraction expression 
{standard input}:348:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_6" minus "L28" 
{standard input}:348:symbol: "L_OBJC_SELECTOR_REFERENCES_6" can't be undefined in a subtraction expression 
{standard input}:347:non-relocatable subtraction expression, "L_OBJC_CLASSLIST_REFERENCES_$_1" minus "L27" 
{standard input}:347:symbol: "L_OBJC_CLASSLIST_REFERENCES_$_1" can't be undefined in a subtraction expression 
{standard input}:345:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_5" minus "L23" 
{standard input}:345:symbol: "L_OBJC_SELECTOR_REFERENCES_5" can't be undefined in a subtraction expression 
{standard input}:159:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_4" minus "L12" 
{standard input}:159:symbol: "L_OBJC_SELECTOR_REFERENCES_4" can't be undefined in a subtraction expression 
{standard input}:158:non-relocatable subtraction expression, "L_OBJC_CLASSLIST_SUP_REFS_$_0" minus "L11" 
{standard input}:158:symbol: "L_OBJC_CLASSLIST_SUP_REFS_$_0" can't be undefined in a subtraction expression 
{standard input}:113:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_1" minus "L6" 
{standard input}:113:symbol: "L_OBJC_SELECTOR_REFERENCES_1" can't be undefined in a subtraction expression 
{standard input}:112:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_3" minus "L5" 
{standard input}:112:symbol: "L_OBJC_SELECTOR_REFERENCES_3" can't be undefined in a subtraction expression 
{standard input}:111:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_2" minus "L4" 
{standard input}:111:symbol: "L_OBJC_SELECTOR_REFERENCES_2" can't be undefined in a subtraction expression 
{standard input}:110:non-relocatable subtraction expression, "L_OBJC_SELECTOR_REFERENCES_0" minus "L3" 
{standard input}:110:symbol: "L_OBJC_SELECTOR_REFERENCES_0" can't be undefined in a subtraction expression 
{standard input}:109:non-relocatable subtraction expression, "L_OBJC_CLASSLIST_SUP_REFS_$_0" minus "L2" 
{standard input}:109:symbol: "L_OBJC_CLASSLIST_SUP_REFS_$_0" can't be undefined in a subtraction expression 
{standard input}:unknown:Undefined local symbol L_objc_msgSendSuper2$stub 
{standard input}:unknown:Undefined local symbol L_objc_msgSend$stub 
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_SUP_REFS_$_0 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_0 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_2 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_3 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_1 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_4 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_5 
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_REFERENCES_$_1 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_6 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_7 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_8 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_10 
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_REFERENCES_$_2 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_9 
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_11 

미리 감사드립니다.

답변

0

RootViewController은 인스턴스가 아닌 클래스의 이름입니다. 클래스 이름이 RootViewController 인 변수의 이름으로 변경하십시오.

0

Objective C는 개체 또는 개체의 클래스 형식에 메서드를 포함 할 수 있습니다. "보기"메서드 (또는이 경우 특성)는 클래스 대신 개체의 메서드입니다. 클래스에 대한 뷰 메소드가 없습니다. JoostK는 클래스 이름 대신 객체 이름 (변수)을 사용해야한다고 옳았습니다.

설명서 및 코드에서 "-"로 시작하는 메서드는 개체 메서드입니다. "+"로 시작하는 클래스는 클래스 메소드입니다.

일반적으로 클래스 메서드는 팩토리 메서드입니다. 대부분의 경우 객체에 메서드를 사용하고 싶습니다. 즉, 변수를 사용합니다.

0

이 오류가 발생했습니다. 제 경우는 맞춤법 오류 때문입니다.

대신 : [self.view의 addSubview : RootViewController.view]

교체 : 참고 : "R"의 작은 자본 [self.view의 addSubview를 : * 다음을 시도하십시오 r * ootViewController.view

작동하지 않는 경우 .h 파일을 닫고 & 클래스의 선언을 붙여 넣으십시오.

가 도움이 희망 :)

나의 새로운 응용 프로그램을 지원하십시오 - 헤로인 거미 : http://itunes.apple.com/us/app/spider-smack/id418269071?mt=8 인용문