[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[S8ObjC] 000 loading

SwikiCodeRobot @> #testS8ObjCLoading

"Resolve library bindings"
S8ObjC resolve: #Foundation.
S8ObjC resolve: #UIKit.
[ S8ObjC resolve: #AbsentFrameWork
] on: Error do: [:ex|
	^self print: 'Ok - ' ,ex description stream nextLine
]


"Import Foundation"
[	S8ObjC import: #Foundation.
] on: Error do: [:ex|
	self print: 'Can''t load Foundation - ',ex toString stream nextLine.
	self abort.
].
(ObjCClass named: #NSObject) isNil ifTrue: [ self error: 'NSObject class missing' ].

S8ObjC import: #UIKit.
(ObjCClass named: #UIImage) isNil ifTrue: [ self error: 'UIImage class missing' ].


"Create an AutoreleasePool"
| api pool |
api := S8ObjC current @ #NSAutoreleasePool.
pool := (api value: #alloc) value: #init.