小编Nav*_*han的帖子

如何为iOS应用程序创建objective-C Framework

我正在创建一些可以在很多应用程序中重用的泛型类.

对于例如:共享函数 - 如果我们在项目中需要此功能,那么我们当前需要在该项目中添加一组类并在该组文件中显示视图控制器.在此视图控制器中有按钮以及所有需要处理共享.

我的想法是,如果项目需要这样的功能,他们需要添加框架并在其中调用函数或在框架中显示指定的视图,即.没有为您执行该项目的代码级访问权限.因此,如果在通用类(框架)中发现任何问题,我需要修复它并重新创建框架并更改使用此框架的所有项目,而不会影响现有项目.

我不仅认为共享功能.更像是图像滑块,PDF查看器,浏览器.封面流程.目前我有所有这些功能的代码.但是,将其整合并使用它需要花费太多时间.如果发现任何问题,我们需要更改所有项目源类.

我在谷歌浏览了几个链接

我可以为Cocoa Touch应用程序开发自己的Objective-C Framework吗?

http://www.cocoanetics.com/2010/04/universal-static-libraries/

为Cocoa(触摸)开发创建自己的库的指南

我无法理解它是如何使用的,有些人还没有完全解释它.这些链接中缺少一些.

提前致谢

iphone frameworks objective-c ipad

7
推荐指数
3
解决办法
1万
查看次数

iOS10 NSLog限制为1024个字符串

在iOS10中,NSlog限制为1024个字符,任何人都知道打印完整字符串的解决方法.

console ios ios10 xcode8

6
推荐指数
1
解决办法
1726
查看次数

如何防止方法被错误地覆盖

如何防止方法在子类中被覆盖,在?中缺少对其超类的实现的调用?
我知道[super methodName];有时会打电话来解决我的问题.
但是,如果其他人要使用我的父级并超越我的方法,不小心失去了打电话给超级,我该怎么办?

更多解释:

我创建了一个viewcontroller VC1,它有一个方法-(void)indexDidChange:(int)index { }.我在那里写了一些我需要每次都要执行的操作.我将这个名为SVC1的viewcontroller子类化,我需要-(void)indexDidChange:(int)index { }做一些其他操作,但同时VC1 -(void)indexDidChange:(int)index { }动作也需要执行.所以我需要打电话,

 -(void)indexDidChange:(int)index { 
[super indexDidChange:index];
}
Run Code Online (Sandbox Code Playgroud)

所以我决定改变VC1的功能,比如

  -(void)indexDidChange:(int)index {
     [self currentIndexDidChange:(int)index];
 }

-(void)currentIndexDidChange:(int)index { }
Run Code Online (Sandbox Code Playgroud)

我需要 - (void)currentIndexDidChange:(int)index {}来覆盖和阻止 - (void)indexDidChange:(int)index {}来覆盖.

可能吗?

methods overriding objective-c

3
推荐指数
1
解决办法
2123
查看次数

iOS 5.1 UISplitviewcontroller不允许来自RootViewController的presentModalViewController

我用来使用以下代码从splitviewcontroller的RootViewcontroller中显示一个viewcontroller.在iOS 5.1纵向模式下它不会显示任何内容.当横向显示Rootviewcontroller内的控制器时.它适用于iOS 5.0.

-(void)displayFileInReader:(NSURL *)fileURL    {

    SPDocumentReader *objiPadDocumentReader = [[SPDocumentReader alloc] init];
    objiPadDocumentReader.readerType = ReaderTypeLocalCachedDocument;
    objiPadDocumentReader.url = fileURL;
    UINavigationController *objNavigationController = [[UINavigationController alloc] initWithRootViewController:objiPadDocumentReader];
    objNavigationController.navigationBar.barStyle = UIBarStyleBlack;

    [self presentModalViewController:objNavigationController animated:YES];

    [objNavigationController release];
    objNavigationController = nil;

    [objiPadDocumentReader release];
    objiPadDocumentReader = nil;
}
Run Code Online (Sandbox Code Playgroud)

我使用self.splitviewcontroller并使用detailviewcontroller实例而不是self.

但是在这种情况下,当我们点击o detailview控制器来解除/删除rootviewcontroller它会导致崩溃时说"没有视图窗口".

有时在iOS 5.1中,RootView显示方向错误.

提前致谢

ipad uisplitviewcontroller ios ios5.1

3
推荐指数
1
解决办法
1069
查看次数

UISplitViewController与IOS 5.1的问题

我有个问题,

我正在使用Monotouch 5.2.8进行IOS 5.1编程.

但是自从IOS 5.1更新后,我的iPad配置了UISplitViewController,因此它停靠在左侧,而不是作为弹出框提供.

它适用于IOS 5.0但在5.1中我遇到了这个问题.

这是我的UISplitViewController的源代码:

splitViewController = new UISplitViewController ();
splitViewController.WeakDelegate = detailViewController;                
splitViewController.ViewControllers = new UIViewController[] {
     navigationController,
     detailViewController                   
};
Run Code Online (Sandbox Code Playgroud)

xamarin.ios uisplitviewcontroller ios5.1

2
推荐指数
1
解决办法
4535
查看次数