pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

在 iOS 5 模擬器上運(yùn)行時,使用 iOS 6.0 SDK 并為 i

using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運(yùn)行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會導(dǎo)致 UIScrollView setMinimumZ
本文介紹了在 iOS 5 模擬器上運(yùn)行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會導(dǎo)致 UIScrollView setMinimumZoomScale 失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

i upgraded to Xcode 4.5 and have started using the iOS SDK 6.0:

i have a universal app that had been developed with Xcode 4.4 and the iOS SDK 5.1

and it had been running on all devices and simulators tested without any glitches.

in hope of having it continue to work on the iPhone 5, i wanted to provide the proper launch-image and let it run.

many parts of the app work without changes, but one part of it does not: an image that i have placed in a UIScrollView does not pan. this has always worked previously, but not on the iOS 6 simulator.

to the real crux of the problem, though: when i went to run on the iOS 5.0 or iOS 5.1 simulators, in my debug log, i am seeing an exception thrown as follows:

-[NSKeyValueMethodSetter setMaximumNumberOfTouches:]: unrecognized selector sent to instance 0x6ddab20

the stack crawl shows that the code attempting to make this call is UIScrollView setMinimumZoomScale.

my code to call setMimimumZoomScale is as follows:

    CGFloat widthScale = self.scrollView.bounds.size.width / self.image.size.width;
    CGFloat heightScale = self.scrollView.bounds.size.height / self.image.size.height;

    // just reset the zoom scales; leave center and everything else where possible
    self.scrollView.minimumZoomScale = MIN(1.0, MIN(widthScale, heightScale));
    self.scrollView.maximumZoomScale = 4.0;

the thrown exception (and subsequent crash) occur on that first call to setMimimumZoomScale with the message noted above.

i am guessing that Xcode 4.5 is using code for setMinimumZoomScale that calls sends that message, which probably exists in the library for iOS 6, but never did in iOS 5.

are others seeing a similar problem?

fwiw, i have not touched my .storyboard files, so they would still be set to work without autoLayout.

do i have to go back and install Xcode 4.4 beside Xcode 4.5 in order to be able to continue to allow my working app to be maintained?

解決方案

answering my own question …

the complexity of my original question involved additional gesture recognizers.

under iOS 5.1 SDK (and some prior), it was possible to add a gesture recognizer to UIScrollView and be able to have it work in conjunction with panGestureRecognizer and pinchGestureRecognizer that are built into the UIScrollView.

under iOS 6.0 SDK, this behavior is apparently no longer really supported. the relevant documentation does not so much explicitly forbid the behavior as it does define what the UIScrollView will do for touches that may or may not be related to pan and pinch.

Because a scroll view has no scroll bars, it must know whether a touch signals an intent to scroll versus an intent to track a subview in the content. To make this determination, it temporarily intercepts a touch-down event by starting a timer and, before the timer fires, seeing if the touching finger makes any movement. If the timer fires without a significant change in position, the scroll view sends tracking events to the touched subview of the content view. If the user then drags their finger far enough before the timer elapses, the scroll view cancels any tracking in the subview and performs the scrolling itself. Subclasses can override the touchesShouldBegin:withEvent:inContentView:, pagingEnabled, and touchesShouldCancelInContentView: methods (which are called by the scroll view) to affect how the scroll view handles scrolling gestures.

in order to rectify the problem, i had to make sure that the gesture recognizers in the storyboard are no longer part of the collection associated with the scrollview, and instead associate them with the content-view of the scrollview.

(in my case, in order to do this, i had to manually add them using addGestureRecognizer: for each gesture-recognizer i am interested in, since the content-view is for images that aren't known at storyboard time.)

這篇關(guān)于在 iOS 5 模擬器上運(yùn)行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會導(dǎo)致 UIScrollView setMinimumZoomScale 失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設(shè)置滾動視圖內(nèi)容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
Create partial-screen UIPageViewController programmatically(以編程方式創(chuàng)建部分屏幕 UIPageViewController)
UIImageView zoom and pinch in UIScrollView(UIImageView 在 UIScrollView 中縮放和捏合)
How can i add more than 10 buttons on a navigationbar in iphone application development?(如何在 iphone 應(yīng)用程序開發(fā)中的導(dǎo)航欄上添加 10 多個按鈕?)
主站蜘蛛池模板: 皮带输送机-大倾角皮带输送机-皮带输送机厂家-河南坤威机械 | 布袋式除尘器|木工除尘器|螺旋输送机|斗式提升机|刮板输送机|除尘器配件-泊头市德佳环保设备 | 100_150_200_250_300_350_400公斤压力空气压缩机-舰艇航天配套厂家 | pos机办理,智能/扫码/二维码/微信支付宝pos机-北京万汇通宝商贸有限公司 | 锡膏喷印机-全自动涂覆机厂家-全自动点胶机-视觉点胶机-深圳市博明智控科技有限公司 | 南京和瑞包装有限公司| 户外健身路径_小区健身器材_室外健身器材厂家_价格-浩然体育 | ERP企业管理系统永久免费版_在线ERP系统_OA办公_云版软件官网 | 滚塑PE壳体-PE塑料浮球-警示PE浮筒-宁波君益塑业有限公司 | 西安展台设计搭建_西安活动策划公司_西安会议会场布置_西安展厅设计西安旭阳展览展示 | 上海律师咨询_上海法律在线咨询免费_找对口律师上策法网-策法网 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 法钢特种钢材(上海)有限公司 - 耐磨钢板、高强度钢板销售加工 阀门智能定位器_电液动执行器_气动执行机构-赫尔法流体技术(北京)有限公司 | 深圳宣传片制作_产品视频制作_深圳3D动画制作公司_深圳短视频拍摄-深圳市西典映画传媒有限公司 | 艺术涂料_进口艺术涂料_艺术涂料加盟_艺术涂料十大品牌 -英国蒙太奇艺术涂料 | 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 泰来华顿液氮罐,美国MVE液氮罐,自增压液氮罐,定制液氮生物容器,进口杜瓦瓶-上海京灿精密机械有限公司 | 深圳市宏康仪器科技有限公司-模拟高空低压试验箱-高温防爆试验箱-温控短路试验箱【官网】 | 阜阳成人高考_阜阳成考报名时间_安徽省成人高考网 | 河南道路标志牌_交通路标牌_交通标志牌厂家-郑州路畅交通 | 喷涂流水线,涂装流水线,喷漆流水线-山东天意设备科技有限公司 | 地脚螺栓_材质_标准-永年县德联地脚螺栓厂家| 纸张环压仪-纸张平滑度仪-杭州纸邦自动化技术有限公司 | 钢结构-钢结构厂房-钢结构工程[江苏海逵钢构厂] | 布袋式除尘器|木工除尘器|螺旋输送机|斗式提升机|刮板输送机|除尘器配件-泊头市德佳环保设备 | 自动化生产线-自动化装配线-直流电机自动化生产线-东莞市慧百自动化有限公司 | 杭州实验室尾气处理_实验台_实验室家具_杭州秋叶实验设备有限公司 | 海外整合营销-独立站营销-社交媒体运营_广州甲壳虫跨境网络服务 焊管生产线_焊管机组_轧辊模具_焊管设备_焊管设备厂家_石家庄翔昱机械 | 蜗轮丝杆升降机-螺旋升降机-丝杠升降机厂家-润驰传动 | 紫外可见光分光度计-紫外分光度计-分光光度仪-屹谱仪器制造(上海)有限公司 | 上海公司注册-代理记账-招投标审计-上海昆仑扇财税咨询有限公司 上海冠顶工业设备有限公司-隧道炉,烘箱,UV固化机,涂装设备,高温炉,工业机器人生产厂家 | 济南货架定做_仓储货架生产厂_重型货架厂_仓库货架批发_济南启力仓储设备有限公司 | 纸张环压仪-纸张平滑度仪-杭州纸邦自动化技术有限公司 | 杜康白酒加盟_杜康酒代理_杜康酒招商加盟官网_杜康酒厂加盟总代理—杜康酒神全国运营中心 | 沥青车辙成型机-车托式混凝土取芯机-混凝土塑料试模|鑫高仪器 | 空压机网_《压缩机》杂志 | 全国冰箱|空调|洗衣机|热水器|燃气灶维修服务平台-百修家电 | 电动打包机_气动打包机_钢带捆扎机_废纸打包机_手动捆扎机 | 专业广州网站建设,微信小程序开发,一物一码和NFC应用开发、物联网、外贸商城、定制系统和APP开发【致茂网络】 | 对辊破碎机_四辊破碎机_双齿辊破碎机_华盛铭重工 | 通风天窗,通风气楼,屋顶通风天窗,屋顶通风天窗公司 | 爱德华真空泵油/罗茨泵维修,爱发科-比其尔产品供应东莞/杭州/上海等全国各地 |