Java等效目标c [英] Java Equivalent objective c
问题描述
这是我的java代码请给我相同的目标c
ObjectInputStream inStream = new ObjectInputStream(getClass()
.getClassLoader ()。getResourceAsStream(keyFile));
key =(SecretKey)inStream.readObject();
NSData * data = [[NSFileManager defaultManager] contentsAtPath:path];
的数据是文件的内容。
如果您需要专门的数据,我建议您学习 NSCoding教程。
我真的很鼓励你学习这些东西,因为这会让Objective-C一个非常强大且易于使用的语言。
非常重要的是委托和协议,它们作为接口工作,赋予具有所需功能的类。 :-O
It is my java code please give me the equivalent Objective c
ObjectInputStream inStream = new ObjectInputStream(getClass()
.getClassLoader().getResourceAsStream(keyFile));
key = (SecretKey) inStream.readObject();
NSData *data = [[NSFileManager defaultManager] contentsAtPath:path];
in data is than the content of the file.
If you want specialized data, I recommend learning from the NSCoding tutorial of the famous Ray Wenderlich.
I really encourage you to learn such stuff, because that makes Objective-C a very powerful and easy to work with language.
Very important are delegates and protocols, which work "as interfaces" to empower classes with needed features. :-O
这篇关于Java等效目标c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!