如何排序UIImage在ios中以降序添加NSMutableArray(How to sort UIImage added NSMutableArray in ios in descending)
我正在为存储到NSMutableArray的UIImage工作。 我如何使用UIImage对其进行排序,因为它不存储任何参数或for-key,我可以使用任何比较器代码对其进行排序。
我正在努力从图像选择器控制器存储UIImage。 将数量的图像存储到NSMutableArray之后。 之后,我需要将My mutable排序为Last In First out(LIFO)。 它目前以先进先出(FIFO)或降序运行。 我们将图像存储到数组如下:
NSMutableArray *images = [NSMutableArray arrayWithCapacity:[info count]]; for (NSDictionary *dict in info) { UIImage *image = [dict objectForKey:UIImagePickerControllerOriginalImage]; [images addObject:image]; } [_currentData addObjectsFromArray:images];
存储后我无法将上次添加的对象排序为图像视图中的第一个显示。 以下代码崩溃对我来说:
NSSortDescriptor *desc = [NSSortDescriptor sortDescriptorWithKey:@"" ascending:NO]; [_currentData sortUsingDescriptors:@[desc]];
我的_currentData是主要的NSMutableArray,我用它在短路后显示在表视图中。
请帮助我排序UIImage存储的NSMutableArray为LAST IN FIRST OUT(LIFO)降序。
I am working for UIImage storing to NSMutableArray. How i can sort it with the UIImage because it's not storing any parameter or for-key by which i can sort using any comparator code.
I am working to store UIImage from image picker controller. After storing numbers of images to NSMutableArray. After that i need to sort My mutable to Last In First out(LIFO). It's currently working as First In First Out(FIFO) or descending. We are storing images to array as follow:
NSMutableArray *images = [NSMutableArray arrayWithCapacity:[info count]]; for (NSDictionary *dict in info) { UIImage *image = [dict objectForKey:UIImagePickerControllerOriginalImage]; [images addObject:image]; } [_currentData addObjectsFromArray:images];
After Storing i am not able to Sort Last added object to First display in image view. Following code Crashes for me:
NSSortDescriptor *desc = [NSSortDescriptor sortDescriptorWithKey:@"" ascending:NO]; [_currentData sortUsingDescriptors:@[desc]];
My _currentData is main NSMutableArray which i am using to display in the table view after shorting.
Please help me For sorting UIImage stored NSMutableArray for LAST IN FIRST OUT(LIFO) descending order.
原文:
最满意答案
作为基本过滤器,您可以使用OnHTTPBeforeCommand事件处理程序(在将命令发送到HTTP服务器之前触发)。
检查Context参数属性,你会发现有用的:
Context.Command Context.OutboundClient.Host Context.OutboundClient.Port Context.Document Context.Headers
我此时从未试图阻止PassTrough,但我敢打赌,如果您确定存在阻止规则匹配,则可以通过在此时引发异常来实现。
As a basic filter you can use the OnHTTPBeforeCommand event handler (which fires before the command is sent to the HTTP server).
Inspect the Context parameter properties, you'll find useful:
Context.Command Context.OutboundClient.Host Context.OutboundClient.Port Context.Document Context.Headers
I never tried to stop the PassTrough at this time, but I bet you can do it by just raising an exception at that point if you determine there's a block rule match.
相关问答
更多-
如何筛选Sinon中的请求(How to filter requests in Sinon)[2023-08-04]
诀窍是在服务器的FakeXMLHttpRequest对象上使用过滤器。 然后,只有您过滤掉的请求才会使用假服务器: server = sinon.fakeServer.create(); server.xhr.useFilters = true; server.xhr.addFilter(function(method, url) { //whenever the this returns true the request will not faked return !url.match(/exa ... -
Indy没有SNMP服务器组件。 要允许应用程序从您的应用程序请求SNMP值,您必须实现自己的SNMP服务器,例如使用TIdUDPServer及其OnUDPRead事件,然后手动解析SNMP请求。 另一个选择是让外部应用程序在您的应用程序中注册自己,然后您的应用程序可以使用TIdSNMP.SendTrap()在需要时将状态更新推送到已注册的应用程序。 Indy does not have an SNMP server component. To allow apps to request SNMP valu ...
-
我相信你不应该使用pin-holing - http://www.indyproject.org/docsite/html/TIdConnectThroughHttpProxy.html CONNECT命令不是WWW的工作方式。 没有浏览器使用它。 这是非WWW程序试图突破防火墙并开放直接访问WWW之外的所有互联网领域的方式。 不要使用“透明代理”类。 使用常规HTTP代理,例如如何使用Indy 10和OpenSSL通过HTTPS下载文件? 顺便说一句,没有这样的事件处理程序,因为你的名字是“HTTPBef ...
-
2016年12月:似乎没有 2017年2月更新:已批准的状态现在是搜索条件的一部分。 审核者已批准的过滤请求: state:open type:pr review:approved 您可以根据问题状态或拉取请求进行搜索 : 您可以根据审核状态( none , required , approved , changes requested或required ),审核人员和请求的审核者过滤提取请求。 类型:pr review:approved :将匹配评论者已批准的拉取请求。 请参阅“ 过滤拉取请求审核和审核请 ...
-
您可以通过从管理面板创建过滤器来过滤掉它。 1转到“管理”选项卡。 2在“查看列”下,选择过滤器,然后单击+添加过滤器添加过滤器按钮Google Anlaytics 3输入名称。 4过滤器类型:自定义和排除 5过滤字段:选择广告系列来源并输入网址 此博客是一个非常全面的过滤垃圾邮件的指南。 You can filter it out by creating a filter from the admin panel. 1 Go to the Admin tab. 2 Under the "View colu ...
-
Facebook请求2.0过滤器(Facebook requests 2.0 filter)[2022-03-16]
我试过这个代码,这对我来说很好 FB.ui( { method: 'apprequests', filters: ['app_non_users'], message: 'msg here!', title: 'title for box' }, function(response) { alert( ... -
您的代码不会写一个空行来终止您要发送的HTTP标头。 在OnBeforeCommand事件处理程序退出后,您还需要抛出异常以防止TIdHTTPProxyServer导航到客户端请求的URL。 尝试这个: void __fastcall TForm3::MyProxyHTTPBeforeCommand(TIdHTTPProxyServerContext *AContext) { if (AContext->Target == "http://xxx.com/need_redirect_url" ) ...
-
使用Indy TIdHTTPProxyServer连接到i2p站点的麻烦(Connecting to i2p sites using Indy TIdHTTPProxyServer trouble)[2022-03-20]
如果连接到您的TIdHTTPProxyServer的HTTP客户端请求.i2p主机名(并且可能是SwitchProxy()在返回3时查找的那个),则OutboundClient.IOHandler将请求TIdConnectThroughHttpProxy与运行的HTTP代理建立套接字连接在127.0.0.1:4444并向其发送命令以从HTTP客户端的原始.i2p请求连接到主机名和端口。 然后,HTTP代理必须使用DNS将.i2p主机名解析为IP,然后才能与该主机建立套接字连接并返回对TIdConnectTh ... -
控制台选项卡上有一个小箭头,您可以关闭它在那里显示的内容。 There is a small arrow on the console tab, you can turn off what it displays there.
-
作为基本过滤器,您可以使用OnHTTPBeforeCommand事件处理程序(在将命令发送到HTTP服务器之前触发)。 检查Context参数属性,你会发现有用的: Context.Command Context.OutboundClient.Host Context.OutboundClient.Port Context.Document Context.Headers 我此时从未试图阻止PassTrough,但我敢打赌,如果您确定存在阻止规则匹配,则可以通过在此时引发异常来实现。 As a basic ...