ios 面试

1.What are the differences between category and subclass? 

继承与category区别?
Answer:
Category:
-Category in objective C allows you to extend the functionality of  existing      class without subclassing    it.
-Category can add some extra functionalities to a class.
-You don't have to declare instance of a specific class with it's name.
-Just import that category and all the Object  become instance of the category implicitly, all the implementation is now available to them.

Subclass

-A subclass inherits methods and instance variables from its superclass.
-Here sometimes,you need to intently override the existing methods to add extra functionalities.
-In case of subclassing,you need to explicitly declare that Object with that subclass name and then all the methods become visible.


2.What happens when you add autorelease two times?
自动autorelease两次会有什么后果?

Answer:
Adding autorelease two times will release the object twice,your app will crash, because you'll be releasing a deallocated object.

3.What is the use of Controller? 

Controller 的作用?
Answer:-

In iOS, the controller is generally a subclass of UIViewController that manages a view, it is also responsible for responding to delegation   messages and target-action messages.

For Example:

You have a UITableViewController which is a subclass of   UIViewController hat manages a UITableView

4.What is the difference between device Token and Device UDID?
device token 和device UDID区别?

Answer:

UDID

-UDID is a number in each iPhone that is used by developers to distribute new apps directly into the phone for testing purposes before they are available in the App Store.

-The UDIDs are used to create an Apple-certified provisioning file that is dragged with the app into iTunes.

You can reveal the UDID by following ways:

-Open Xcode organizer after connecting a device to your computer.Now, you can see UDID of a particular device as 'identifier'

or

1. Connect your device to your computer, and run iTunes.

2. Select your device in the 'Device' list.

3. Click the Serial Number. It will switch to displaying your UDID.

Device Token

-An identifier for the Apple Push Notification System for iOS devices. - -Each device has two device tokens 

– One is used for development, and one for production (ad hoc or app store builds). The tokens are 64 hexadecimal characters.

5.What are the advantages and disadvantages of using StoryBoard?

storyBoard 的优缺点?
Answer:
Advantages:

  •  It's  very nice to design interfaces

  • You can use  StoryBoard Segues to identify navigation/modal    relationships in a cool manner.

  • If your app supports multiple devices, it's a good way to       organize different views.

  • Prototyping is another added advantage.

  • Prototype UITableViewCell can save time and it reduce the   amount of the code too.

  • you can see all the screens of the app at one place  by using StoryBoard.

  • You can easily view  the relationship among them

  • if you are working on someone's  code you can get the better        understanding of the flow of the app.

  • You can setup the user interface for iPhone 4 and iPhone 5 by applying the retina form factor from storyboard, without running the app again and again.

  • Clients can see the prototype of the app before start developing it, here storyboard helps you a lot.

Disadvantages:

  •  It is only available in iOS 5

  • StoryBoardSegues are kind of rigid and you may make use of       prepareForSegue many times.

  • Like IB, not very friendly with other display engines and toolkits.

  • Makes it hard to share designs for a single view or set of views - you have to send all or nothing.

  • For storyboard you will need a big screen specially in case of iPad.

  • Difficulty while copying views from other apps to storyboard.

  • Problems in storyboard when multiple developers work on the same project by using git repository.

  • Another disadvantage with Storyboarding not mentioned is that

       merges can be very difficult if not impossible if there are conflicts.

6.Which framework handles events when the application is in foreground mode?
应用程序处于前景模式时事件处理框架?

  • (a).UIKit

  • (b).corefoundation

  • (c).CoreGraphics

  • (d).None of the above


Answer:

  • (a)UIKit



7.What is local notification?

本地通知?
Answer:-

Local notifications  are ways for an application that isn’t running in the foreground to let its users know it has information for them. The information could be a message, an impending calendar event, or new data on a remote server

8.Difference between JSON and XML which one you should prefer ?

JSON XML 区别?
Answer:

JSON

  • JSON is the most natural representation for Javascript apps, and Javascript is arguably the most popular language in the world, and growing

  • JSON is one type of text-based format or standard for interchanging  data i.e. human readable.

  • JSON syntax is lighter than XML as JSON has serialized format of data having  less redundancy. JSON does not contain start and end tags.

  • JSON is light – weighted in compare to XML as it has serialized format and so faster also.

  • JSON supports datatype including integer and strings, JSON also supports array.

  • JSON has support of native objects.

  • JSON does not support Comments.

  • JSON does not have support for Namespaces.

  • JSON is data oriented and can be mapped more easily.

  • JSON uses only evel() for parsing i.e. for interpreting the JavaScript code & returns the result. It does not need any additional code for parsing.

  • For Web services, JSON is better.

  • You can not change JSON data to other format.

  • In JSON no such is interface for getting direct access to a part in JSON data-structure.

XML

  • XML is a Markup Language having format that contains set of rules for the encoding the documents which is readable for both human & machine

  • XML is not so lighter as JSON as having start and end tags and it takes more character than JSON to represent same data.

  • XML is not so light weighted as JSON.

  • XML does not provide any data type so needs to be parsed into particular datatype. No direct support for array also.

  • XML can get support of objects through mixed use of attributes & elements.

  • XML supports comments.

  • XML supports Namespaces.

  • XML is document oriented and needs more effort for mapping.

  • XML needs XML Document Object Model (DOM)                           implementation & with that additional code for mapping text back to the JavaScript objects.

  • For configuration, XML is better.

  • In XML, using XSLT you can change XML data into another format like comma –delimited, plain text, JSON, etc.

  • In XML, Using XPath, it is possible to get the direct access to a particular part of multiple parts of XML data- structure.


9.What is the difference between Selector and SEL?


Selector 和SEL区别?

Answer:

selector:-
It can be meant as name of a method used to send message to a Object

SEL:
-It is called as Compiled selector.
-It is also a unique identifier that replaces a name when source code is compiled.

10.What is SDLC?

什么是SDLC?
Answer:
-it is called software development life cycle.
-Systematic approach to build a software that will support client business.

Various SDLC models are :
-watefall model
-Incremental model
-Spiral model
-Vshaped model
-prototype model
-Hybrid model

11.What is dynamic typing and dynamic binding?

动态类型和动态绑定
Answer:-

Dynamic Typing:
Determining class of a Object at runtime is called dynamic typing.
Dynamic binding:
Determining the method to invoke at run time is called dynamic binding.

12.How  Objective C is different from c/c++?

oc与c/c++区别?
Answer:-

-Objective C Allows method name and variable name exactly the same.
-It doesn't have the constructor or destructor instead,it has init and dealloc which must be called explicitly.
-It uses '+' and '-' to differentiate factory and instance methods.
-It uses dynamic linking.
-It got categories

13.Difference between Core data and sqlite?

core Data 与sqlite区别
Answer
Core Data:

  • It's not a RDBMS

  • It's much high level

  • It stores data in it's own binary

  • It can store huge amount of data 


Sqlite

  • It is RDBMS

  • It has potential for cross platform compatibility.

  • Early databases in iPhone are written in Sqlite.

  • It can store small amount of data



14. Difference between a delegate and NSNotification.

delegate 与通知区别
Answer:

Delegate and NSNotifications are used to accomplish nearly the same functionalities.However,delegates are one to one but NsNotifications are one to many.
Delegate can send message to one object at a time but NSNotifications can send message to all the objects of that Application.

15.Give some Ideas about waterfall and agile technologies?

瀑布流和敏捷开发
Answer:-

Waterfall model

  • The requirements are defined without much or any interaction of the development team.

Agile Technology

  • There is a continuous refining of requirements as        development proceeds due to constant interaction between requirement defining team and development team.

- See more at: http://huntmyideas.weebly.com/blog/ios-interview-questions-with-answers-part4#sthash.e6uTtcgo.dpuf


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值