Giter VIP home page Giter VIP logo

macollectionutilities's People

Contributors

flovilmart avatar iljaiwas avatar mikeash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macollectionutilities's Issues

Please add tag, so podspec can be updated

Please add a tag to the most recent commit, so I can update the CocoaPod podspec file to point to it.

Seems there is a bug in the CocoaPods trunk push command, that doesn't let me update the pod, even though I use the --allow-warnings option.

ilja$ pod trunk push --allow-warnings

[!] Found podspec `MACollectionUtilities.podspec.json`
Validating podspec
 -> MACollectionUtilities (0.1.0)
    - WARN  | [source] Git sources should specify a tag.

[!] The Pod Specification did not pass validation.

Add SORTED macro

A SORTED macro would reduce the verbosity of doing custom collection sorts:

a = SORTED(b, [a compare: b options: NSCaseInsensitiveSearch | NSNumericSearch]);

As a bonus, it could be made to work on sets/dictionaries, returning a sorted array of their contents.

Using DICT Macro causes segmentation fault

The DICT macro is never able to create a dictionary because a segmentation fault occurs in the static inlined function "MADictionaryWithKeysAndObjects". The compound literal (array of objects) keysAndObjs' elements points to objects on the heap that are no longer valid when that function attempts to subscript the array.

After a bit of investigation I found that if I made the "MADictionaryWithKeysAndObjects" a normal function that is not inlined the keysAndObjs array pointed to valid objects and the macro worked. I ensured that the compiler didn't optimize the MADictionaryWithKeysAndObjects into an inlined function by stepping through the assembly and ensuring that it used "call" instead of "jmp".

Oddly, it appears that the elements of keysAndObjs are being prematurely deallocated when MADictionaryWithKeysAndObjects is inlined. However, what is stranger, is that my dictionary contained a set of string literals as key/values which would make me think that those objects couldn't be deallocated anyhow since they are global strings.

This was happening consistently on the iOS Simulator 4.2 with both GCC 4.2 and LLVM GCC 4.2.

Code Snippet:

DICT(@"A", @"B", @"C", @"D");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.