现在是黑色背景的白点.如果我想要它是白色背景的黑点呢?
- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(6_0)
{
return _imageArrays.count;
}// The number of items reflected in the page indicator.
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(6_0)
{
return self.intCurrentIndex;
}// The selected item reflected in the page indicator.
Run Code Online (Sandbox Code Playgroud) 在博士你可以.
在html中,你可以使用<script src="...">标记
但是如果我们有一个.js文件并且我们想要包含另一个.js文件呢.我们怎么做?
似乎按钮根本没有被按下.
我试过了:
然而,这是捕获
如果UIPageViewController的页面转换是UIPageViewControllerTransitionStyleScroll那么
self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;
NSLog(@"%@",self.pageViewController.gestureRecognizers.description);
NSLog(@"%@",self.pageViewController.gestureRecognizers.description);
Run Code Online (Sandbox Code Playgroud)
只会是空的.
我尝试将自己的gestureRecoqnizers而不是按钮添加到UIViewControllers的子视图中.它仍然无法正常工作.
所以我有一个UIPageViewController,它显示一个UIViewController,它的视图有一些按钮.如何按下该按钮?
我也在这里试过两个解决方案:
http://emlyn.net/posts/stopping-gesture-recognizers-in-their-tracks
没有用.首先,我无法禁用UIPageViewController的手势重新整理器,因为没有这样的东西.在scrollView模式下,UIPageViewController没有手势重新整理器.
我试图将自己的手势重新整理器添加到我自己的按钮,但这些从未被调用过.
我希望UIPageViewController仍然可以处理滑动.但不要点击.
我无法访问UIPageViewControllers的手势重新生成器,因为self.pageViewController.gestureRecognizers为空.UIPageViewController似乎只是"吸收"所有点击事件.所以我的按钮没有得到它.
我可以在UIPageViewController前添加按钮,但该按钮将吸收我希望UIPageVIewController仍然处理的滑动动作.
顺便说一句,如果我们使用来自IOS的模板(创建基于页面的应用程序,并更改过渡以滚动pageviewcontroller.gesturerecoqnizers将为空
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Configure the page view controller and add it as a child view controller.
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];//Turn this to scroll view
self.pageViewController.delegate = self;
SDDataViewController *startingViewController = [self.modelController viewControllerAtIndex:0 storyboard:self.storyboard];
NSArray *viewControllers = @[startingViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward …Run Code Online (Sandbox Code Playgroud) Warning: no rule to process file '$(PROJECT_DIR)/YIFullScreenScrollDemo/../../Classes/UIViewController+YIFullScreenScroll.m' of type file for architecture i386
Run Code Online (Sandbox Code Playgroud)
我正在尝试实现YIFullScreenScrollDemo
在保持失败之后,我只需将整个.h和.m文件复制到主项目中.其实我继续参考.
现在这个代码例如,传递编译检查:
self.fullScreenScroll = [[YIFullScreenScroll alloc] initWithViewController:self scrollView:self.tableView];
Run Code Online (Sandbox Code Playgroud)
然而,在运行时,我得到了:
YIFullScreenScrollDemo[82387:c07] -[FirstViewController setFullScreenScroll:]: unrecognized selector sent to instance 0x7577e80
Run Code Online (Sandbox Code Playgroud)
我还得到了这4个警告:
Warning: no rule to process file '$(PROJECT_DIR)/YIFullScreenScrollDemo/../../Classes/UIViewController+YIFullScreenScroll.m' of type file for architecture i386
Warning: no rule to process file '$(PROJECT_DIR)/YIFullScreenScrollDemo/../../Classes/YIFullScreenScroll.m' of type file for architecture i386
Warning: no rule to process file '$(PROJECT_DIR)/YIFullScreenScrollDemo/../Pods/JRSwizzle/JRSwizzle.m' of type file for architecture i386
Warning: no rule to process file '$(PROJECT_DIR)/YIFullScreenScrollDemo/../../Classes/UIView+YIFullScreenScroll.m' of …Run Code Online (Sandbox Code Playgroud) 我收到了这个错误:
/business/Dropbox/badgers/BadgerNew/BGProfileView.m:56:17: Auto property synthesis will not synthesize property declared in a protocol
Run Code Online (Sandbox Code Playgroud)
我知道自动属性合成不会合成协议中声明的属性
所以我综合了我的自我.
这是协议:
@protocol BGIhaveNavigationController <NSObject>
@property (readonly)UINavigationController * navigationController;//This is the problematic property
@end
@protocol BGCommonProtocol <NSObject>
@end
Run Code Online (Sandbox Code Playgroud)
至于实施
@interface BGProfileView : UIViewController
@end
Run Code Online (Sandbox Code Playgroud)
是一个UIViewController,我们知道UIViewController有一个navigationController属性.那有什么不对?
当我使用它时,事情会出现问题:
@interface BGProfileView () <BGReviewsTableDelegateProtocol>
Run Code Online (Sandbox Code Playgroud)
BGReviewsTableDelegateProtocol协议继承BGIhaveNavigationController协议
我可以添加以下命令来删除警告:
-(UINavigationController *) navigationController
{
return self.navigationController;
}
Run Code Online (Sandbox Code Playgroud)
但那太荒谬了.从某种意义上说
-(UINavigationController *) navigationController
{
return self.navigationController;
}
Run Code Online (Sandbox Code Playgroud)
-(UINavigationController *) navigationController 已经通过UINavigationController存在
还有可能吗?我的意思是弱指针会自动为空.强指针只有在指向其他地方时才会解除分配.
我们仍然可以指向解除分配的对象吗?
__unsafe_unretained由知道他们正在做什么的人完成.所以这不是真的错误.
NSObject类有NSObject协议.
重点是什么?
这是模拟多重继承的某种方式吗?
这是什么模式?
NSString * urlCached = URL.CacheImageURL;
NSURL * url = [NSURL URLWithString:urlCached];
NSData * data=[NSData dataWithContentsOfURL:url];
Run Code Online (Sandbox Code Playgroud)
它适用于大多数URL.但是,如果网址包含http://google.com/Hello World.htm 等 空格,则无法使用.
我该怎么做这些网址?
说A是B的子类
说A有一个类别doThis.
B也有一个类别doThis.
说我做了
B* b = [[B alloc]init];
[b doThis];
Run Code Online (Sandbox Code Playgroud)
是否有保证在B + doThis.h中声明的doThis将被称为A + doThis?
样品:
在NSManagedObject + somecategories.m中
+(void)vLoadBookmark
{
//Just empty
}
Run Code Online (Sandbox Code Playgroud)
后者
在BusinessObject + somecategories.m中,其中BusinessObject是NSManagedObject的子类
+(void)vLoadBookmark
{
//Do something
}
Run Code Online (Sandbox Code Playgroud)
如果有一天我打电话[someBusinessObject vLoadBookmark]//会做些什么吗?
[oqlMyOperationQueue cancelAllOperations];
PO([oqlMyOperationQueue operations]);
Run Code Online (Sandbox Code Playgroud)
我仍然在那里看到一堆操作.
2013-05-06 16:05:38.559 [oqlMyOperationQueue operations]: (
"<NSBlockOperation: 0x20222730>",
"<NSBlockOperation: 0x2041f7a0>",
"<NSBlockOperation: 0x20450830>",
"<NSBlockOperation: 0x20417bf0>",
"<NSBlockOperation: 0x2006d510>",
"<NSBlockOperation: 0x2000d150>",
"<NSBlockOperation: 0x20379810>",
"<NSBlockOperation: 0x2021f8f0>",
"<NSBlockOperation: 0x2045dca0>",
"<NSBlockOperation: 0x2024c670>",
"<NSBlockOperation: 0x2041b8e0>",
"<NSBlockOperation: 0x203d54a0>",
"<NSBlockOperation: 0x20442c80>",
"<NSBlockOperation: 0x20452930>",
"<NSBlockOperation: 0x20363af0>"
)
Run Code Online (Sandbox Code Playgroud)
但是我取消了所有的操作.所以有什么问题?
好的,我知道如果一个操作已经执行,它将保留在队列中.但是为什么还有这么多呢?队列是串行的.