我有添加视图[self.view addSubview:RootViewController.view]
的代码,它给了我错误error: accessing unknown 'view' class method
这里有更多可能有用的东西。
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 :(得分:0)
RootViewController
是类的名称,而不是实例的名称。将其更改为类RootViewController
的对象所赋予的变量的名称。
答案 1 :(得分:0)
Objective C可以在对象中使用方法,也可以在对象的类类型中使用方法。 “view”方法(或本例中的属性)是对象而不是类的方法。班上没有查看方法。 JoostK说得对,你需要使用对象名称(变量),而不是类名。
在文档和代码中,以“ - ”开头的方法是对象方法。以“+”开头的是类方法。
类方法通常是工厂方法。大多数情况下,您需要在对象上使用方法,即使用变量。
答案 2 :(得分: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 块引用