【发布时间】:2014-03-24 04:20:33
【问题描述】:
我正在开发一个使用 splitView 的应用程序。
我在 splitView 中使用了两个项目(分别称为 Customer 和 Supplier)。
当我点击其中一个时,我只使用一个 viewController 来显示(称为:ContactViewController),我使用 collectionView 来显示它的数据。要获取数据,我只需对其进行编码:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (!dbManager.synchronized) {
if (contactType == ContactTypeCustomer)
[dbManager requestData:kDbCustomers predicate:nil target:self];
else if (contactType == ContactTypeSuppplier)
[dbManager requestData:kDbSuppliers predicate:nil target:self];
}
}
当获得成功时:
#pragma mark
#pragma DBDelegate
- (void)requestDataCompleted:(NSMutableArray *)results
{
datasource = results;
[self.collectionView reloadData];
}
我使用从github.com下载的I3DragBetweenHelper
嵌入到我的应用程序中以进行初始拖放。为此,我将以下方法调用到 ContactViewController
的 viewDidLoad- (void) initDragAndDrop
{
self.helper = [[I3DragBetweenHelper alloc] initWithSuperview:self.view
srcView:_collectionView
dstView:_collectionView];
self.helper.delegate = self;
self.helper.isDstRearrangeable = NO;
self.helper.isSrcRearrangeable = NO;
self.helper.doesSrcRecieveDst = NO;
self.helper.doesDstRecieveSrc = YES;
self.helper.hideDstDraggingCell = YES;
self.helper.hideSrcDraggingCell = NO;
}
这里的助手是:
@property (strong, nonatomic) I3DragBetweenHelper *helper;
问题是当我点击Supplier时,我可以将collectionView的单元格拖放到ContactViewController中.以下方法已调用并有效:
- (BOOL)droppedOutsideAtPoint:(CGPoint)pointIn fromDstIndexPath:(NSIndexPath *)from
但是当我点击 Customer 时,上面的方法没有调用。我什至无法将我的 collectionView 单元格拖到 ContactViewController 中。任何帮助将不胜感激。
【问题讨论】:
-
无法在 iPad 上运行 ..这意味着您的应用在其他 iOS 设备上运行?
-
另一个人编辑了我的问题标题。我的 iPad 应用程序可以工作,但不是全部。请阅读我的问题。
标签: ios objective-c drag-and-drop